Loading spinner
Dan Edwards Developer icon

Dan Edwards developer

26 April 2025

What’s the type for a Transaction in Drizzle?

Drizzle ORM logo with yellow loading bars on black background

Drizzle doesn’t provide a type for transactions, so you need to extract it yourself.

types/definitions/database.ts
TypeScript
1import type { drizzle } from 'drizzle-orm/node-postgres'
2
3export type DrizzleClient = ReturnType<typeof drizzle>
4export type Transaction = Parameters<Parameters<DrizzleClient['transaction']>[0]>[0]