Skip to content

feat(effect-tursodatabase): Effect-native driver for the Rust Turso engine (closes #5962)#5963

Open
artile wants to merge 1 commit into
drizzle-team:betafrom
artile:feat/effect-tursodatabase
Open

feat(effect-tursodatabase): Effect-native driver for the Rust Turso engine (closes #5962)#5963
artile wants to merge 1 commit into
drizzle-team:betafrom
artile:feat/effect-tursodatabase

Conversation

@artile

@artile artile commented Jun 30, 2026

Copy link
Copy Markdown

Closes #5962.

What

Adds the drizzle-orm/effect-tursodatabase entrypoint — an Effect-native driver for the in-process Rust Turso engine (@tursodatabase/database) — at full parity with drizzle-orm/effect-libsql.

  • queries return Effect instead of Promise
  • the connection is a composable Layer (TursoClient.layer from @effect/sql-tursodatabase)
  • typed SqlError
  • interruption + OpenTelemetry tracing + transactions come from the shared sqlite-core/effect session (identical to every other effect-* driver)

API mirrors effect-libsql exactly:

import { TursoClient } from "@effect/sql-tursodatabase"
import * as TursoDrizzle from "drizzle-orm/effect-tursodatabase"
import { Effect } from "effect"

const program = Effect.gen(function*() {
  const db = yield* TursoDrizzle.makeWithDefaults({ relations })
  const rows = yield* db.select().from(tasks) // Effect, typed SqlError, interruptible
}).pipe(Effect.provide(TursoClient.layer({ url: ":memory:" })))

Why

1.0.0-rc.4 shipped 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 CONCURRENT concurrent 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 relationship effect-libsql has with @effect/sql-libsql. The peer/dev/optional-peer wiring in drizzle-orm/package.json matches the existing @effect/sql-* entries. The lockfile is intentionally not touched here: @effect/sql-tursodatabase needs 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-tursodatabase linked in): CREATE / INSERT / SELECT and a db.transaction(...) all flow correctly through effect-tursodatabaseTursoClient → the Rust engine. tsc --noEmit, oxlint, and dprint are clean on the new files. Follow-ups (out of scope here): Effect variants for tursodatabase-serverless and tursodatabase-sync.

…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
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.

1 participant