You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
preserves the existing D1 declarations and runtime classes while adding the neutral Sqlite*Like capability names, optional SqliteFirstCapability, and neutral quad aliases
adds the isolated @gnolith/diamond/node-sqlite subpath with a Node 22.16+ runtime guard, same-connection statement ownership, FIFO connection mutex, BEGIN IMMEDIATE ordered batches, rollback, WAL/foreign-key/busy-timeout setup, and explicit close/dispose lifecycle
adds the package-neutral _gnolith_migrations ledger with namespaced IDs, SHA-256 checksums, atomic ledger/application batches, race convergence, and explicit adoption records
makes initializeStore() migrate or conservatively adopt Diamond's exact existing RDF schema without replaying destructive DDL
bumps the planned feature release to 0.4.0 and documents embedded/file/memory/concurrency/migration behavior
Why
Headless and Docker-hosted Gnolith processes need Diamond's existing atomic SQLite semantics without Cloudflare provisioning, a database server, or Node imports leaking into Worker consumers. Higher-level packages still own their schemas, while Diamond owns the shared low-level adapter and migration ledger capability.
Validation
npm run check
139 tests pass; 95.83% statement and 90.99% branch coverage
real Miniflare/workerd D1 migration matrix: fresh, repeat, legacy adoption/data preservation, partial rejection, drift/unknown history, rollback/recovery, racing initialization, namespace isolation
exact packed package consumer imports root, endpoint, and node-sqlite, persists/reopens a file, bundles/runs the Worker path, and asserts no node:sqlite leakage
Addressed the independent review findings in 88fd5db:
legacy adoption now inspects the complete SQLite catalog and rejects any unexpected index, trigger, or view targeting or referencing Diamond tables, including unrelated-name triggers
Node runtime guard now models release lines exactly: 22.16+, 23.11+, or 24+
every ArrayBuffer/view binding is copied at bind time
the ledger must match the exact STRICT CREATE schema and constraints, not only table_info
emitted Node declarations no longer expose the raw connection or executor
INSERT/UPDATE/DELETE RETURNING retain positional rows and report meta.changes from a total_changes() delta
Validation: full npm run check passes with 156 tests, 96.19% statements, and 91.75% branches. Real workerd D1 includes adversarial trigger and non-STRICT ledger probes; exact-package smoke asserts the Node declaration has no connection/executor escape hatch.
Re-review index bypasses are fixed in 39beef2. Every expected index now requires a catalog row whose tbl_name is exactly rdf_quads; explicit indexes must also match the canonical CREATE INDEX DDL, so partial predicates, sort/collation changes, and other semantic drift fail closed. Regression fixtures prove wrong-table same-name/same-columns and correct-table partial indexes are rejected without adoption. Full npm run check passes: 159 tests, 96.19% statements, 91.73% branches.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Sqlite*Likecapability names, optionalSqliteFirstCapability, and neutral quad aliases@gnolith/diamond/node-sqlitesubpath with a Node 22.16+ runtime guard, same-connection statement ownership, FIFO connection mutex,BEGIN IMMEDIATEordered batches, rollback, WAL/foreign-key/busy-timeout setup, and explicit close/dispose lifecycle_gnolith_migrationsledger with namespaced IDs, SHA-256 checksums, atomic ledger/application batches, race convergence, and explicit adoption recordsinitializeStore()migrate or conservatively adopt Diamond's exact existing RDF schema without replaying destructive DDLWhy
Headless and Docker-hosted Gnolith processes need Diamond's existing atomic SQLite semantics without Cloudflare provisioning, a database server, or Node imports leaking into Worker consumers. Higher-level packages still own their schemas, while Diamond owns the shared low-level adapter and migration ledger capability.
Validation
npm run checknode-sqlite, persists/reopens a file, bundles/runs the Worker path, and asserts nonode:sqliteleakageCloses #40
Closes #41
Closes #42