15 const int rc = sqlite3_open(path.c_str(), &db_);
16 if (rc != SQLITE_OK) {
19 const char* msg = sqlite3_errmsg(db_);
27 const std::string message =
28 std::string(
"Failed to open sqlite db '") + path +
"'" +
29 (err.empty() ? std::string() : std::string(
": ") + err);
30 throw std::runtime_error(message);
Declares the lightweight SQLite connection wrapper.
Declares schema initialization and migration helpers for SQLite.
SqliteDb(const std::string &path)
Open a SQLite database at the given path.
~SqliteDb()
Close the database connection.
static void ensure(sqlite3 *db)
Ensure the database schema exists and is migrated.