Skip to content

Search the guides, deployment pages, and API reference.

D1TransactionMode

import type { D1TransactionMode } from "@pitlane/data-table-d1";
type D1TransactionMode = "throw" | "unsafe-nonatomic";

How the driver answers a transaction() call.

  • throw refuses, because D1 cannot honour it. The default.
  • unsafe-nonatomic accepts and runs each statement immediately, each committing on its own. A failure part-way leaves the earlier writes persisted, with no rollback. For code shared with a backend that does have transactions, where the alternative is not running at all.