Commit 8974514
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
- src
- db
- domain/graph/builder
- stages
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
0 commit comments