Add Void::Sqlite — RAII SQLite wrapper with migrations
New SHARED module (separate from Data so Json/Csv/Ini consumers don't link SQLite). Generic, Result-based: - Database — open (file or :memory:), exec, prepare, begin, last_insert_rowid, changes; enables WAL + busy timeout + foreign_keys for writable modes. - Statement — move-only prepared statement; 1-based typed bind (int/double/ text/null/optional), step(), reset, 0-based column accessors. - Transaction — RAII; rolls back on scope exit unless commit() is called. - Migration + Database::migrate() — forward, in-order, idempotent schema upgrades tracked via PRAGMA user_version. Dependencies.cmake resolves SQLite::SQLite3 via find_package. Tests exercise CRUD, null handling, commit/rollback, migrations and errors on :memory:. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
c92dff6ff7
commit
cb639a713d
5 files changed
+579
No files matched your search
@@ -45,6 +45,13 @@ function(void_fetch_dependency DEP_NAME)
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(DEP_NAME STREQUAL "SQLite")
|
||||
if(NOT TARGET SQLite::SQLite3)
|
||||
find_package(SQLite3 REQUIRED)
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
# FIXME: Add if needed external
|
||||
# if(DEP_NAME STREQUAL "glaze")
|
||||
# if(NOT glaze_POPULATED)
|
||||
|
||||
Reference in new issue
Block a user