Skip to content

fix: run a drizzle database over every driver it supports - #81

Merged
colinhacks merged 4 commits into
mainfrom
drizzle-every-driver
Oct 23, 2026
Merged

colinhacks merged 4 commits into
mainfrom
drizzle-every-driver

Conversation

@colinhacks

Copy link
Copy Markdown
Owner

.run() already took a Drizzle database over pg, postgres.js, mysql2, better-sqlite3 and libSQL, the five pairings the driver matrix tested. This tests every other driver Drizzle wraps that Reylo also takes, fixes the one that failed, and lists them all in the docs.

The fix. drizzle-orm/durable-sqlite keeps the Durable Object's storage, ctx.storage, on its session, while Reylo runs on ctx.storage.sql. So a Drizzle database over a Durable Object was a type error, and refused at run time. .run() and .runSync() now take its sql, inside its synchronous transactions too. DrizzleDatabase accepts a { sql } storage in SqliteClient and SyncClientFor<"sqlite">. A unit test covers it with the Durable Object fake the other tests use.

The driver matrix gains seven Drizzle jobs, each with every scenario the plain driver runs:

Job Rows Result
Neon's Pool over WebSocket (neon-serverless) 80 all pass
Neon's neon() over HTTP (neon-http) 25 all pass; Drizzle has no transaction there
PGlite 80 all pass
Bun.sql (Postgres) 80 77 pass, 3 skipped as for plain Bun.sql
PlanetScale (planetscale-serverless) 65 63 pass; the 2 failures are the same S8 rows the plain driver records, the simulator answering 403 to concurrent queries in one session
bun:sqlite 20 all pass
D1, through Miniflare 20 all pass; Drizzle has no transaction there
  • Drizzle imports Neon's, PlanetScale's and PGlite's packages by their own names, so the matrix installs those names beside the versioned aliases.
  • The PlanetScale simulator keeps a MySQL connection open for every session, about 70 per job. A third PlanetScale job ran MySQL 8.4 past its default 151 connections ("Too many connections", HTTP 500 on every transaction), so the matrix's MySQL 8.4 container now starts with --max-connections=1000.
  • The type check gains a case per pairing, 714 in all, every one as expected. Drizzle over Bun.sql is accepted on every dialect, as Bun.sql itself is, since its client is Bun's one SQL class for the three adapters.

Docs. Each database page's driver row and Drizzle section list every pairing, and say where Drizzle has no transactions (Neon's HTTP driver, D1). The agent skill now mentions a Drizzle database.

Checked locally: typecheck, the loader's tests, the docs site, and both driver-matrix gates, the containers included; RESULTS.md matches the run row for row (4,524 rows over 64 jobs).

Copilot AI balanced review requested due to automatic review settings October 23, 2026 19:51
@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
reylo Ready Ready Preview Oct 23, 2026 8:07pm UTC

Request Review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues. One small note inline.

Reviewed changes

I reviewed the whole PR: the Durable Object fix in src/execute.ts, the seven new Drizzle jobs in the driver matrix and its type-check cases, and the docs and skill updates.

  • The Durable Object fix: underneath() now takes .sql from the client that the Drizzle session keeps, when that .sql passes isDurableObjectSql. DrizzleDatabase<…> in SqliteClient and SyncClientFor<"sqlite"> also accepts { sql } storage. I checked this against the source of drizzle-orm@0.45.4/durable-sqlite/session.js. SQLiteDOSession stores ctx.storage as this.client. transaction() passes that same session to SQLiteDOTransaction and runs client.transactionSync(...), and a nested transaction goes through session.transaction again. So .run() and .runSync() reach ctx.storage.sql both on the database and inside its transactions.
  • New driver-matrix jobs: the new jobs are Neon over WebSocket and over HTTP, PGlite, Bun.sql, PlanetScale, bun:sqlite and D1. The jobs with no Drizzle transaction (Neon HTTP and D1) skip S7. bun:sqlite uses only the database shape, as better-sqlite3 already does. The D1 job reuses the S10 rule that the driver rounds BIGINT values.
  • Type-check cases: there are 48 new cases, one per pairing, including DrizzleSqliteDODatabase & { $client: DurableObjectStorage }. Bun.sql is accepted on all three dialects.
  • MySQL container setting: the MySQL 8.4 container now starts with --max-connections=1000, because ps-http-sim keeps a connection open for each session.
  • Docs and skill: each database page's driver row and Drizzle section now lists every pairing and notes where Drizzle has no transactions. The skill now mentions a Drizzle database.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using claude-opus-5-5 | 𝕏

Comment thread lab/driver-matrix/RESULTS.md Resolved
@colinhacks
colinhacks force-pushed the drizzle-every-driver branch from bd680b1 to f9f90e1 Compare October 23, 2026 20:05
@colinhacks
colinhacks merged commit dbf6399 into main Oct 23, 2026
6 checks passed
@colinhacks
colinhacks deleted the drizzle-every-driver branch October 23, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants