Repository navigation
feat: add store-sqlite package - #27
Conversation
367a598 to
02f4dbc
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
02f4dbc to
c71ded7
Compare
The participant kinds, pseudo roles, message modes, fragment operators, overlay statuses and notations were already const tuples but only their types were exported. A storage adapter needs the values to declare enumerated columns from the model's own vocabulary rather than a copy, and elementKinds names the Element variants, pinned by a type test.
The GraphStore port on SQLite through drizzle-orm 1.0.0-rc.4, written against Drizzle's async SQLite database type so any driver plugs in. One table definition in src/tables.ts, with enumerated columns taken from graph-schema's vocabulary; a mapping layer flattens a model into rows and parses rows back with modelSchema; a unit test derives the row schemas with drizzle-orm/zod and asserts they agree with the model schema. The drizzle-kit SQL migrations are committed. The build embeds them via drizzle's own readMigrationFiles and migrate applies the missing ones through values and run, so a Node process and a browser worker apply the same statements; drizzle's migrators read node:fs or need object-mode reads the sqlite-proxy session refuses. A test checks migrate and drizzle's node-sqlite migrator build the same schema and journal. ready, blockedChain and impact are single WITH RECURSIVE queries through the sql template, reading a stored loop flag from graph-domain's loopTransitions. The store passes the conformance kit over node:sqlite. The adapters layer gets its knip workspace entry with this first package.
c71ded7 to
86d713a
Compare
|
@codex security review |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
@codex security review |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
🎉 This PR is included in version 1.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Adds
@exadev/process-graph-store-sqlite, theGraphStoreport on SQLite throughdrizzle-orm1.0.0-rc.4, stacked on #26.It is written against Drizzle's async SQLite database type (
SQLiteAsyncDatabase<"sync" | "async">), sonode-sqliteandsqlite-proxyboth plug in; the driver packages come in the next PRs.src/tables.tsis the single table definition, with enumerated columns taken from graph-schema's vocabulary (exported from graph-schema in its own commit here).src/rows.tsis the mapping layer: it flattens a model into rows and parses rows back withmodelSchema, so storage layout never reaches the contract. A unit test derives the row schemas withdrizzle-orm/zod(no drizzle-zod) and asserts they agree with the model schema on every shared scalar field.The drizzle-kit migration under
drizzle/is committed. Drizzle's own migrators cannot run in the browser worker (drizzle-orm/migratorimportsnode:fs, andmigrateAsyncneeds object-mode reads the proxy session refuses; details in #22), so the build embeds the folder using drizzle's ownreadMigrationFilesandmigrateapplies it throughvaluesandruninto the same__drizzle_migrationsjournal. A test checks it produces the same schema and journal as drizzle'snode-sqlitemigrator on the committed folder, and that each finds nothing left after the other. The embedded module is build output and gitignored.query.ready,query.blockedChainandquery.impactare singleWITH RECURSIVEqueries through thesqltemplate, reading aloopflag written from graph-domain'sloopTransitions. Transactions use plainBEGIN IMMEDIATE/COMMIT/ROLLBACKbecause Drizzle'stransactioncallback has to be sync on a sync driver and async on an async one; every operation runs under an injectableexclusive, which the wasm driver will use for its cross-tab Web Lock.The conformance kit passes over
node:sqlitein memory; a file database also round-trips across a reopen. The contract commit on the base branch adds a conformance case for a cycle without a decision, which caught the SQL walk reporting the start element.npm name to reserve before the first release:
npm-reserve @exadev/process-graph-store-sqlite --trust ExaDev/process-graph --workflow ci.yml.