-
-
Notifications
You must be signed in to change notification settings - Fork 512
Open
Labels
bugSomething isn't workingSomething isn't working
Description
What version of Effect is running?
@effect/sql:0.49@effect/sql-sqlite-do:0.27.0effect:3.19.13- Runtime: Cloudflare Workers / workerd Durable Objects with SQLite
What steps can reproduce the bug?
Here is minimal repro
https://github.com/mykola-vrmchk/effect-sqlite-do-tx-repro
1. Run and observe
pnpm install
pnpm wrangler dev --local2. In another terminal:
curl -i http://localhost:8787/no-tx
curl -i http://localhost:8787/tx3. Summary
On Cloudflare Durable Objects with SQLite (state.storage.sql), SQL-managed transactions are forbidden (e.g. BEGIN, COMMIT, ROLLBACK). However SqlClient.withTransaction(...) in @effect/sql implements transactions by issuing those SQL statements. As a result, using @effect/sql-sqlite-do inside a Durable Object causes withTransaction to fail at runtime.
What is the expected behavior?
@effect/sql-sqlite-doprovides a Durable Object–aware transaction implementation that usesstate.storage.transaction(...)(i.e., not SQL statements)
What do you see instead?
/no-txsucceeds (basic queries work)./txfails (500), becausewithTransactiontries to executeBEGIN/COMMIT/ROLLBACKvia DO SQLite, which workerd forbids. The error is commonly wrapped asSqlError: Failed to execute statement.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working