Skip to content

Commit 8974514

Browse files
authored
perf(db): NativeDatabase napi-rs class for rusqlite connection lifecycle (6.13) (#666)
* perf(db): add NativeDatabase napi-rs class for rusqlite connection lifecycle (6.13) Foundation for moving all DB operations to rusqlite on the native engine path. Creates a persistent rusqlite::Connection holder exposed to JS, handling schema migrations and build metadata KV — eliminating redundant per-call connection open/close in the native build pipeline. * fix(rust): resolve NativeDatabase compilation error and harden init_schema (#666) - Fix E0507 in close(): use (*self.conn).take() to deref through SendWrapper and call Option::take instead of SendWrapper::take which consumes self - Wrap each migration in an explicit transaction so a mid-migration crash rolls back cleanly instead of leaving the DB in an unrecoverable state - Add ORDER BY rowid DESC LIMIT 1 to schema_version query to handle potential duplicate rows deterministically - Document pragma() as read-only with guidance to use exec() for write PRAGMAs * fix(build): remove redundant String() conversion in setBuildMeta (#666) All values in the metadata object are already strings (explicitly coerced via String() in the object literal), so the outer .map() String() wrapper was a no-op.
1 parent 9890c69 commit 8974514

7 files changed

Lines changed: 674 additions & 16 deletions

File tree

crates/codegraph-core/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pub mod extractors;
1010
pub mod import_resolution;
1111
pub mod incremental;
1212
pub mod insert_nodes;
13+
pub mod native_db;
1314
pub mod parallel;
1415
pub mod parser_registry;
1516
pub mod roles_db;

0 commit comments

Comments
 (0)