---
title: "D1TransactionMode"
description: "How the driver answers a `transaction()` call."
url: "https://pitlane.tools/package/data-table-d1/type/D1TransactionMode"
---

# D1TransactionMode

```ts
import type { D1TransactionMode } from "@pitlane/data-table-d1";
```

```ts
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.
