The explicit database layer for modern C++ systems
Deterministic · Predictable · No magic
Vix DB is the database foundation of Vix.cpp.
It gives you a direct, explicit, and predictable way to work with databases in C++ without hiding anything.
auto db = vix::db::Database::sqlite("vix.db");
auto conn = db.pool().acquire();
conn->prepare("SELECT 1")->exec();No setup. No hidden layers. No surprises.
Most database tools today:
- hide SQL behind heavy abstractions
- introduce implicit behavior
- make performance unpredictable
- couple your code to a framework
This creates systems that are:
- harder to debug
- harder to optimize
- harder to maintain over time
Vix DB does the opposite.
You control everything. The system stays transparent.
- SQL is explicit
- transactions are explicit
- connections are explicit
- behavior is deterministic
No hidden queries. No implicit state. No magic.
Vix DB is built for environments where things actually matter:
- high-load backend services
- edge and offline-first systems
- unreliable networks
- long-running production systems
This aligns directly with the philosophy behind Vix.cpp and Softadastra:
Systems must keep working, even when conditions are not ideal.
Vix DB focuses on fundamentals done right:
- connection pooling (thread-safe)
- explicit transactions (RAII)
- prepared statements
- deterministic query execution
- migration system (code + files)
- clean driver abstraction (MySQL, SQLite)
- zero runtime overhead
- zero hidden allocations
Everything is:
opt-in · explicit · predictable
All complexity is inside Vix. Your code stays minimal.
auto db = vix::db::Database::sqlite("vix.db");auto db = vix::db::Database::mysql(
"tcp://127.0.0.1:3306",
"root",
"",
"vixdb"
);auto conn = db.pool().acquire();
auto st = conn->prepare("SELECT id, name FROM users WHERE age > ?");
st->bind(1, std::int64_t(18));
auto rs = st->query();
while (rs->next())
{
const auto &row = rs->row();
std::cout << row.getInt64(0) << " " << row.getString(1) << "\n";
}vix::db::Transaction tx(db.pool());
tx.conn().prepare("INSERT INTO users (name) VALUES (?)")
->bind(1, std::string("Alice"))
->exec();
tx.commit();Supports both:
- code-based migrations
- file-based migrations
vix::db::MigrationsRunner runner(conn);
runner.runAll();Vix DB is not an ORM.
It is the foundation layer.
If you want higher-level abstractions, Vix provides an optional ORM module.
If you don’t:
Vix DB is complete on its own.
No forced abstraction. No lock-in.
- C++20
- RAII everywhere
- explicit ownership
- no hidden lifetimes
- clean error handling
If you like clear and intentional C++, this will feel natural.
Drivers (MySQL / SQLite)
↓
Connection Pool
↓
Database (Facade)
↓
Your code / ORM (optional)
Clear layers. No coupling. No surprises.
Vix DB is part of Vix.cpp, an offline-first, peer-to-peer, high-performance C++ runtime.
It integrates with:
- Vix Core
- Vix CLI
- ORM (optional)
- WebSocket / networking
- future distributed systems (Softadastra)
Build with examples:
cmake -S . -B build -DVIX_DB_BUILD_EXAMPLES=ON -DVIX_DB_USE_SQLITE=ON
cmake --build buildRun:
./build/examples/vix_db_example_sqlite_basicThis is not just another DB wrapper.
It is part of a bigger vision:
Rebuilding reliable systems for real-world conditions.
- explicit control
- deterministic behavior
- offline-first ready
- production-first mindset
If you believe:
- C++ deserves modern infrastructure
- systems should be predictable
- databases should not hide behavior
then consider starring the project.
👉 https://github.com/vixcpp/vix
MIT License