InArray Function not Working

Why is the drizzle Function inArray mapping my array from ['1ed01d30-d16d-4b8f-b5d0-01b2a5d94d13', '37fdf74f-4069-4eab-8eee-5ad282c66667'] to (('1ed01d30-d16d-4b8f-b5d0-01b2a5d94d13', '37fdf74f-4069-4eab-8eee-5ad282c66667')) the Double brackets are messing everything up what is goin on
12 Replies
Andrii Sherman
What version of drizzle-orm are you using?
Fil
FilOP2y ago
0.17.6
Andrii Sherman
drizzle-orm not drizzle-kit
Fil
FilOP2y ago
0.25.4
Andrii Sherman
Seems like a regression from 0.23.6 https://github.com/drizzle-team/drizzle-orm/issues/382
GitHub
[BUG]: "inArray" operator doesn't work as expected · Issue #382 · d...
What version of drizzle-orm are you using? 0.23.5 Describe the Bug
Andrii Sherman
will reopen this issue and fix asap
Fil
FilOP2y ago
Okay thanks is there a way to do the inArray function in raw SQL for now?
Andrii Sherman
yes
.where(sql`${table.column} in (${}, ${})`)
.where(sql`${table.column} in (${}, ${})`)
use column and values you need in templates
Fil
FilOP2y ago
could I do ${(,)} or do the brackets have to be strings?
Andrii Sherman
each string should be separate template to make proper query parameterizing
Fil
FilOP2y ago
aight then I wont use In cuz i need a way to search an unknown length of variables oh wait u can just pass an array in the sql statement
Dan
Dan2y ago
yes, array param should be parens-escaped automatically
Want results from more Discord servers?
Add your server