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';
}
}
Consume vsqlite++ through CMake, C++ package managers, or native Linux packages built from tagged releases.
Build and install from source, then use the exported
vsqlite::vsqlitepp target from downstream projects.
cmake -S . -B build -DBUILD_SHARED_LIBS=ON
cmake --build build
cmake --install build --prefix /usr/local
Embed the project directly. Tests, examples, and install rules default to off when vsqlite++ is used as a subproject.
FetchContent_Declare(vsqlitepp
GIT_REPOSITORY https://github.com/vinzenz/vsqlite--
GIT_TAG v${VSQLITEPP_VERSION})
FetchContent_MakeAvailable(vsqlitepp)
Use CPM.cmake if your project already centralizes CMake dependencies that way.
CPMAddPackage(
NAME vsqlitepp
GITHUB_REPOSITORY vinzenz/vsqlite--
GIT_TAG v${VSQLITEPP_VERSION})
The repository includes a Conan 2 recipe and package test for validating generated packages.
conan create . --build=missing \
-s compiler.cppstd=20
Until vsqlite++ is accepted into the curated registry, use the checked-in overlay port.
vcpkg install vsqlitepp \
--overlay-ports=packaging/vcpkg
Tags matching v* publish source archives, Debian packages, RPM
packages, and Arch Linux pacman packages to
GitHub Releases.
Join the maintainers, contributors, and teams building on top of vsqlite++.