#include "sqlite.hpp"
#include <iostream>
int main()
{
sqlite::Connection connection("example.db");
connection.Statement("CREATE TABLE IF NOT EXISTS example ("
"id INTEGER PRIMARY KEY AUTOINCREMENT, "
"textData TEXT, "
"intData INTEGER, "
"floatData REAL)");
connection.Statement("INSERT INTO example (textData, intData, floatData) "
"VALUES (?,?,?)",
"Hello world",
1,
1.23);
sqlite::Result result = connection.Query("SELECT * FROM example");
while(result.Next())
{
std::cout
<< result.Get<int>(0) << " "
<< result.Get<std::string>(1) << " "
<< result.Get<int>(2) << " "
<< result.Get<float>(3) << std::endl;
}
return 0;
}
-
Notifications
You must be signed in to change notification settings - Fork 0
Single file header only SQLite wrapper for C++
License
ToniLipponen/cpp-sqlite
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Single file header only SQLite wrapper for C++
Topics
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published