Commit e5a718d
refactor: extract WasmDatabaseEngine and platform fs helper
Splits src/core/sqlite-db.ts (1270 lines) into three modules:
- src/core/engine/wasm/WasmDatabaseEngine.ts — the engine class plus
its sql.js type interfaces. Preserves SAVEPOINT-based updateCellBatch,
hasJsonPatch construction-time probe, safeRollback helper, and the
BEGIN/COMMIT path in deleteColumns/insertRowBatch byte-faithfully.
- src/core/platform/fs.ts — getNodeFs helper, lifted from sqlite-db so
both sqlite-db and the engine can import it without re-establishing
a circular dependency (sqlite-db → engine → sqlite-db).
- src/core/sqlite-db.ts — slim factory (createDatabaseEngine) and
worker endpoint (createWorkerEndpoint), with WasmDatabaseEngine and
getNodeFs re-exported for back-compat with existing imports.
Net: sqlite-db.ts 1270 → 259 lines. No public-API changes, no
behavior changes. Tests: 247/247 pass. Build: clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent ddda6b1 commit e5a718d
3 files changed
Lines changed: 1042 additions & 1022 deletions
0 commit comments