When working with drizzle in our project, we noticed that declaring the type of the transaction when passing it to a function was kind of unclear at first regarding what we needed to pass for the parameters:
I have the exact same use case (seeding a DB with a large number of entries) and need to pass tx to functions.
Does tx: typeof db look like a solution, since tx and db have a similar type?
What version of
drizzle-orm
are you using?0.32.0
What version of
drizzle-kit
are you using?0.23.0
Describe the Bug
When working with drizzle in our project, we noticed that declaring the type of the transaction when passing it to a function was kind of unclear at first regarding what we needed to pass for the parameters:
export abstract class MySqlTransaction< TQueryResult extends MySqlQueryResultHKT, TPreparedQueryHKT extends PreparedQueryHKTBase, TFullSchema extends Record<string, unknown> = Record<string, never>, TSchema extends TablesRelationalConfig = Record<string, never>
I think adding a comment here that explains the parameters or an example how to use it could be helpful
Expected behavior
No response
Environment & setup
No response