Skip to content

Commit 39b8bf7

Browse files
committed
adding sqlite logger
1 parent 1e2cab4 commit 39b8bf7

File tree

9 files changed

+869
-1
lines changed

9 files changed

+869
-1
lines changed

3rdparty/cpp-sqlite/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## Single file header only sqlite wrapper for C++
2+
3+
## Example
4+
```cpp
5+
#include "sqlite.hpp"
6+
#include <iostream>
7+
8+
int main()
9+
{
10+
sqlite::Connection connection("example.db");
11+
12+
sqlite::Statement(connection, "CREATE TABLE IF NOT EXISTS exampleTable ("
13+
"textData TEXT, "
14+
"intData INTEGER, "
15+
"floatData REAL)");
16+
17+
sqlite::Statement(connection,
18+
"INSERT INTO exampleTable VALUES (?, ?, ?)",
19+
"Hello world",
20+
1234,
21+
5.6789);
22+
23+
sqlite::Result res = sqlite::Query(connection, "SELECT * FROM exampleTable");
24+
25+
while(res.Next())
26+
{
27+
std::string textData = res.Get(0);
28+
int intData = res.Get(1);
29+
float floatData = res.Get(2);
30+
31+
std::cout << textData << " " << intData << " " << floatData << std::endl;
32+
}
33+
34+
return 0;
35+
}
36+
37+
```

0 commit comments

Comments
 (0)