feat(effect-tursodatabase): Effect-native driver for the Rust Turso engine (closes #5962)#5963
Open
artile wants to merge 1 commit into
Open
feat(effect-tursodatabase): Effect-native driver for the Rust Turso engine (closes #5962)#5963artile wants to merge 1 commit into
artile wants to merge 1 commit into
Conversation
…ngine Add the drizzle-orm/effect-tursodatabase entrypoint at parity with drizzle-orm/effect-libsql, built on the new @effect/sql-tursodatabase TursoClient. Queries return Effect, the connection is a composable Layer, errors are typed SqlError, and transactions/interruption/OpenTelemetry come from the shared Effect SQL session. This closes the one gap in the Effect v4 driver matrix shipped in 1.0.0-rc.4: the Rust Turso engine (@tursodatabase/database) was the only major driver without an Effect-native variant. Closes drizzle-team#5962
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.
Closes #5962.
What
Adds the
drizzle-orm/effect-tursodatabaseentrypoint — an Effect-native driver for the in-process Rust Turso engine (@tursodatabase/database) — at full parity withdrizzle-orm/effect-libsql.Effectinstead ofPromiseLayer(TursoClient.layerfrom@effect/sql-tursodatabase)SqlErrorsqlite-core/effectsession (identical to every othereffect-*driver)API mirrors
effect-libsqlexactly:Why
1.0.0-rc.4shipped the Effect v4 driver matrix but left the Rust Turso engine as the only major driver with just the regular async driver (drizzle-orm/tursodatabase) and no Effect-native variant. Users wanting the Rust engine specifically (MVCC /BEGIN CONCURRENTconcurrent writes, CDC) had to choose between "real Rust Turso (no Effect-native)" and "Effect-native (libSQL / plain SQLite only)". This closes that gap.Dependency
This entrypoint is built on a new first-party Effect SQL client,
@effect/sql-tursodatabase(TursoClient), submitted upstream as Effect-TS/effect-smol#2509 — the same relationshipeffect-libsqlhas with@effect/sql-libsql. The peer/dev/optional-peer wiring indrizzle-orm/package.jsonmatches the existing@effect/sql-*entries. The lockfile is intentionally not touched here:@effect/sql-tursodatabaseneeds to be published first (coordinated with the upstream PR); regenerate the lockfile at that point, exactly as for the other@effect/sql-*betas.Test
Verified end-to-end against a real in-memory Turso engine (local build of
@effect/sql-tursodatabaselinked in):CREATE/INSERT/SELECTand adb.transaction(...)all flow correctly througheffect-tursodatabase→TursoClient→ the Rust engine.tsc --noEmit,oxlint, anddprintare clean on the new files. Follow-ups (out of scope here): Effect variants fortursodatabase-serverlessandtursodatabase-sync.