drizzle-team / drizzle-orm

Headless TypeScript ORM with a head. Runs on Node, Bun and Deno. Lives on the Edge and yes, it's a JavaScript ORM too 😅
https://orm.drizzle.team
Apache License 2.0
24.56k stars 645 forks source link

[BUG]: Transaction object does not have type for $client #3282

Closed jakeleventhal closed 2 weeks ago

jakeleventhal commented 2 weeks ago

What version of drizzle-orm are you using?

0.35.3

What version of drizzle-kit are you using?

0.26.2

Describe the Bug

I have functions that take in an optional parameter for a transaction object. For example:

const updateEmail = async (email: string, tx = db) => {...}

This code allows me to optionally perform this in a transaction. When upgrading to 0.35, this code no longer works because $client is not available on the tx object.

Expected behavior

$client is available on transaction object

Environment & setup

No response

L-Mario564 commented 2 weeks ago

Closing in favor of https://github.com/drizzle-team/drizzle-orm/issues/3175.