Drizzle where query problems
I am using drizzle. In my below aPI I cant get my where request to correctly get me my restricted products. When i call the API, it says no restrictions found for product id 63905 which is wrong as I have the below row that DOES have that ID????
db obj example sent in next msg
12 Replies
if you take the drizzle query and run on the database, does ir return the data?
running
^ ran that query and returns nothing
Is my schema simply flawed?
let me check
I was babied using Prisma 😅
for products, most likely the "63905"
should be 63905
usually for simple conversions postgres would ignore it
but for jsonb operations you need correct types
you can even drop the
::jsonb
from the inArray
calls, postgres does automatically the castingWOW your amazing. That was it. I feel very stupid for missing that thanks!
sql isnt the most fun thing but glad that helped you
Haha true, your a legend really saved me