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
![No description](https://cdn.answeroverflow.com/1261130021549113396/2024-07-11_at_18.20.062x.png)
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
![No description](https://cdn.answeroverflow.com/1261133064919318598/Screenshot_2024-07-11_at_22.32.17.png)
![No description](https://cdn.answeroverflow.com/1261133065250672713/Screenshot_2024-07-11_at_22.32.23.png)
![No description](https://cdn.answeroverflow.com/1261133065569177720/Screenshot_2024-07-11_at_22.32.30.png)
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 casting![No description](https://cdn.answeroverflow.com/1261133953763381309/Screenshot_2024-07-11_at_22.36.02.png)
WOW 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