How to get the type of transaction from a database?
I wanna pass a transaction to a function, how can I get the type for the function declaration?
4 Replies
import { type PostgresJsDatabase } from "drizzle-orm/postgres-js";
but how can i get the transaction type, enriched with the schema types?
best i've come up with is:
I did it like this: it allows to pass regular db conn or transaction
is my solution to this.
A function can use either DB, TX or DbOrTx as their prop/arg.