Repository navigation
Conversation
This was referenced Nov 24, 2026
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Do not merge. Merging
feat/d1-storeends MySQL support inmain. It is held for the production switch-over (plan section 7). Draft on purpose.Refs #248 (slices S1a and S1b of the D1 clone plan).
Before
server/src/db.tswas a MySQL pool (@effect/sql-mysql2), configured byMYSQL_*.server/src/migrate.tsran MySQL DDL steps underGET_LOCK.tests/support/mysql-server.ts).ci.ymlandchangelog.ymlran only formain.After
dbLayer({ url })builds a SQLite-dialectSqlClientover aDbBackend:node:sqlite(db-sqlite.ts) or the D1 gateway (db-d1.ts).SANCTUM_DB_URLreplaces allMYSQL_*.tx_clockguard. A lost race reruns the body (4 times, jittered). A read after a buffered write fails withSqlError. Nested transactions join the parent.increment,isDuplicate,isMissingReference,isCheckViolationandsql-dialect.ts(now,addSeconds,diffSeconds,diffMicros,chunked).migrate.tsappliesmigrations-d1/NNNN_*.sqlto file or memory databases, one transaction per file, ledger tabled1_migrations(same tablewrangler d1 migrations applyuses).createTestDatabase()returns a migrated shared-cache in-memory database; no global setup, no Docker.mysql-server.tsandpool.test.tsare deleted (the MySQL pool no longer exists).ci.ymlandchangelog.ymlalso run forfeat/d1-store.mysql2and@effect/sql-mysql2removed fromserver/package.json.Verification
db.test.ts(12) andmigrations.test.ts(7): all pass on Node 24.22.3 (FTS5 included) and on Node 26.12.1. They ran with a temporary vitest config;server/vitest.config.tsno longer has a global setup.tscshows no error in the files this PR owns.Known red
server/migrations-d1/0001_baseline.sqlbelongs to slice S0 (PR tomain). It is not in this branch yet.migrations.test.tsand every test that callscreateTestDatabase()need it: mergemainafter S0 lands. I tested with a local copy of S0's baseline fromfm/sanctum-d1-s0, not committed.mysqlErrno,ER_*,hasFullText,MysqlOptions,config.mysql). Slices S2 to S11 own them.db.test.ts("schema constraints") were removed; the baseline and its parity test (S0) cover the schema.Ponytail review
One round on my own diff. Cut: the unused
bigintbranch in the D1 encoder. Kept:executeStreamandexecuteValues(theConnectioninterface requires them); the nested-transaction shortcut is marked in code.