RAII-first design
Connections, transactions, savepoints, and results automatically clean up.
vsqlite++ wraps the SQLite C API with exception-safe RAII objects, connection pooling, JSON & FTS helpers, and batteries-included utilities so you can focus on your data.
Whether you are shipping an embedded appliance or orchestrating microservices, vsqlite++ keeps your data layer tidy with expressive, zero-footgun primitives.
Connections, transactions, savepoints, and results automatically clean up.
Use the built-in connection pool to safely multiplex SQLite handles across tasks.
JSON path builders, FTS match/rank helpers, snapshot & session utilities.
C++20 + CMake
#include <sqlite/connection.hpp>
#include <sqlite/execute.hpp>
#include <sqlite/query.hpp>
#include <iostream>
int main() {
sqlite::connection db("demo.db");
sqlite::execute(db, "CREATE TABLE IF NOT EXISTS notes(id INTEGER PRIMARY KEY, text TEXT);", true);
sqlite::execute insert(db, "INSERT INTO notes(text) VALUES(?);");
insert % "Hello from vsqlite++";
insert();
sqlite::query rows(db, "SELECT id, text FROM notes ORDER BY id DESC;");
for(auto & row : rows.each()) {
std::cout << '[' << row.get(0) << "] "
<< row.get(1) << '\n';
}
}
Ship directly from source or pull the prebuilt packages and keep your toolchains in sync.
vsqlite::vsqlitepp directly with
FetchContent_Declare(vsqlitepp
GIT_REPOSITORY https://github.com/vinzenz/vsqlite--
GIT_TAG v${VSQLITEPP_VERSION})
set(VSQLITE_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(VSQLITE_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(vsqlitepp)
cmake -S . -B build -DBUILD_SHARED_LIBS=ON -DVSQLITE_BUILD_EXAMPLES=ON.
Join the maintainers, contributors, and teams building on top of vsqlite++.