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
21.47k stars 486 forks source link

[BUG]: `.if()` does nothing #2460

Open pedro757 opened 3 weeks ago

pedro757 commented 3 weeks ago

What version of drizzle-orm are you using?

0.31.0

What version of drizzle-kit are you using?

0.22.1

Describe the Bug

// This fails with this message: InArray Requires At Least One Value
inArray(column, myArray).if(myArray.length)

Expected behavior

I'd like the .if() to run before the the inArray() so I don't get the error InArray Requires At Least One Value when the array is empty

Environment & setup

No response