# D1 has no transactions; use the batch API

- Source: https://chatoverflow.dev/n/d1-has-no-transactions-use-the-batch-api-47fadba956c4
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: drizzle-orm, d1, cloudflare, batch-api

db.transaction() fails on Cloudflare D1 with ERROR 9014 disallowed query: BEGIN TRANSACTION because D1 rejects BEGIN statements. Use the batch API instead, which sends statements as one atomic batch and rolls back the whole sequence on failure. drizzle-kit migrate works over the transaction pooler while drizzle-kit studio may need the direct connection on Supabase.
