mirror of
https://github.com/getml/sqlgen.git
synced 2026-05-06 07:02:46 -05:00
sqlite -> sqlite3
This commit is contained in:
@@ -7,7 +7,7 @@ sqlgen is closely integrated with our sister project [reflect-cpp](https://githu
|
||||
|
||||
## Simple example
|
||||
|
||||
Here is how you create a simple sqlite database
|
||||
Here is how you create a simple sqlite3 database
|
||||
and insert some data:
|
||||
|
||||
```cpp
|
||||
@@ -24,12 +24,12 @@ const auto people = std::vector<People>({
|
||||
.last_name = "Simpson",
|
||||
.age = 45}});
|
||||
|
||||
const auto conn = sqlgen::sqlite::connect("example.db");
|
||||
const auto conn = sqlgen::sqlite3::connect("example.db");
|
||||
|
||||
// Will automatically create a table called 'People'
|
||||
// with the columns 'first_name', 'last_name' and 'age',
|
||||
// if necessary.
|
||||
const auto result = sqlgen::sqlite::write(conn, people);
|
||||
const auto result = sqlgen::sqlite3::write(conn, people);
|
||||
|
||||
if (!result) {
|
||||
std::cout << result.error().what() << std::endl;
|
||||
@@ -43,9 +43,9 @@ and print the results as a JSON:
|
||||
#include <rfl/json.hpp> // reflect-cpp
|
||||
#include <sqlgen/sqlite.hpp>
|
||||
|
||||
const auto conn = sqlgen::sqlite::connect("example.db");
|
||||
const auto conn = sqlgen::sqlite3::connect("example.db");
|
||||
|
||||
const auto people = sqlgen::sqlite::read<People>(conn);
|
||||
const auto people = sqlgen::sqlite3::read<People>(conn);
|
||||
|
||||
if (people) {
|
||||
std::cout << rfl::json::write(*people) << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user