chore(rivetkit): remove wasm sqlite runtime#4614
Conversation
PR Review: chore(rivetkit): remove wasm sqlite runtimeThis is a substantial simplification (+877 / -11,318). The direction is correct: eliminating the WASM/KV-backed SQLite path removes a large amount of complexity and aligns with the fail-by-default principle in CLAUDE.md. Notes below. Bugs1. Cache entry leak on bridge error in index.cts In dynamic-isolate-runtime/src/index.cts, createNativeDatabaseBridge deletes from the cache after the bridge call. If bridgeCall throws, the stale entry remains in nativeDatabaseCache. A subsequent open() call returns the broken handle instead of a fresh one. By contrast, isolate-runtime.ts dbCloseRef correctly deletes before calling close(). Apply the same order here. 2. bigint precision loss in native-database.ts SQLite INTEGER is 64-bit. Number(bigint) is lossy for values outside +/-(2^53-1). Row IDs, epoch timestamps stored as integers, and user-defined 64-bit values can silently lose precision. Either add a safe-integer guard and throw, or change the native binding to accept a string/bigint representation. At minimum, add a comment documenting this boundary. 3. Stale column names for multi-statement exec in isolate-runtime.ts For a multi-statement DDL/query string, columns ends up holding the column names from the last result set only. The rows from earlier statements are associated with the wrong column names. Low impact because exec is DDL-only in practice, but worth fixing for correctness. Style violations (CLAUDE.md)4. Delta comment in bench-sqlite.ts Per CLAUDE.md: Documenting deltas is not important or useful. The comment describes what was removed rather than what is. Replace with a forward-looking comment explaining what the block does now, or remove it if the code is self-evident. Data migration concern5. Orphaned WASM SQLite KV data SQLITE_PREFIX ([8]) is removed from keys.ts. Any actors whose data was written by the WASM VFS path will see an empty database after this deploys. The KV entries at that prefix will be unreachable. If any production actors used the WASM path, a migration or release note is needed before this lands. Minor observations
SummaryThe simplification is large and well-motivated. Three things should be addressed before merging: the cache-entry leak on close error (#1), the bigint precision hazard (#2), and confirming there are no production actors relying on the WASM SQLite KV path (#5). The delta comment (#4) is a quick fix. |
Preview packages published to npmInstall with: npm install rivetkit@pr-4614All packages published as Engine binary is shipped via Docker images: docker pull rivetdev/engine:slim-822b57f
docker pull rivetdev/engine:full-822b57fIndividual packagesnpm install rivetkit@pr-4614
npm install @rivetkit/react@pr-4614
npm install @rivetkit/rivetkit-native@pr-4614
npm install @rivetkit/workflow-engine@pr-4614 |
4bd0fb1 to
ab9f56f
Compare
a145cda to
2e5abc9
Compare
2e5abc9 to
ac6753a
Compare
ab9f56f to
d00c2b0
Compare
ac6753a to
ebe2cff
Compare

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: