Embedded SQLite forKBVESQLite
An embedded SQLite database plugin for Unreal Engine — a vendored sqlite3 amalgamation plus a thin RAII wrapper so consumers never touch raw sqlite3_* calls.
One sqlite provider
Never link the engine's SQLiteCore in the same module — duplicate sqlite3_* symbols crash the build and run. KBVESQLite is the single sqlite provider for KBVE code.
- Not a Mass hot-loop datasource — a persistence boundary only.
- WAL — many readers + one writer across separate connections.
What it gives you
Access seam
FKBVESQLiteConnection
RAII connection: Open(path, bUseWAL) / Close / Exec / Prepare / Begin / Commit / Rollback.
FKBVESQLiteStatement
RAII prepared statement: Bind*, Step / Execute / Reset, Column* accessors.
FKBVESettingsStore
Scoped key/value prefs on a connection (kv_settings(scope, key, value), UPSERT) — typed Set/Get String, Int, Float, Bool plus RemoveKey and LoadScope. Agnostic settings persistence; UI is KBVEUI's job.
Integration
Rules & consumers
Add KBVESQLite to your module’s PrivateDependencyModuleNames (and to the
consuming plugin’s .uplugin Plugins list). The plugin exports the sqlite3_*
entry points from its own binary, so consumers call them directly without
bundling a second copy.
Rules
- Single sqlite provider — never link the engine’s
SQLiteCorein the same module; duplicatesqlite3_*symbols crash the build/run. - Persistence boundary, not a Mass hot-loop datasource — one connection is not thread-safe; WAL gives many readers + one writer across separate connections. Load at boundaries, keep the working set in memory/Mass fragments, flush async.
Consumers: FKBVEWorldChunkCache (KBVEWorld, terrain chunk BLOB cache) and
FKBVEInventoryStore + FKBVEItemCatalogStore (KBVEItemDB, inventory
persistence and a queryable item catalog).
Questions
Frequently asked
What is the KBVESQLite plugin?
KBVESQLite wraps SQLite as an embedded database plugin for Unreal Engine, bundling a vendored sqlite3 amalgamation with a thin RAII wrapper so consumers never touch raw sqlite3 calls. It exposes FKBVESQLiteConnection, FKBVESQLiteStatement, and a scoped key/value FKBVESettingsStore.
Why must KBVESQLite be the single SQLite provider?
Consumers must never also link the engine's SQLiteCore in the same module, because duplicate sqlite3 symbols crash the build and run. KBVESQLite is the one sqlite provider for KBVE code.
How should KBVESQLite be used in a Mass game loop?
It is a persistence boundary, not a Mass hot-loop datasource. A single connection is not thread-safe; WAL allows many readers and one writer across separate connections, so you load at boundaries, keep the working set in memory or Mass fragments, and flush asynchronously.
Discuss on the forum
Questions, fixes and notes on this page live in the KBVE forum.