type alias DrizzleTransaction
Since 0.2.0

The native transaction object supplied by a configured Drizzle database.

This derives the callback parameter structurally, without importing a dialect- or version-specific Drizzle type into production source. It keeps schema/query inference while excluding operations available only on the outer database (for example SQLite Proxy's batch()).

Type Parameters

TDatabase extends object

The application's configured outer Drizzle database type

Definition

TDatabase extends { transaction: infer TMethod; } ? TMethod extends (...args: infer TArguments) => unknown ? TArguments[0] extends (
transaction: infer TTransaction,
...args: never[]
) => unknown ? TTransaction : never : never : never

Usage

import { type DrizzleTransaction } from "database-plugin/src/index.ts";