[Beginner] Drizzle select with eq not working
Hi, Im trying drizzle for the first time and seems like theres something wrong with the way I use select with eq
14 Replies
This is not returning the existing users
But these two seems to work
any help is appreciated on what im doing wrong with the first picture
Where are you importing eq from?
drizzle-orm
And it’s not throwing any error
It just returns an empty array even though there is records in DB
Please do this. Take the first query, the one where you're having issues, remove the await and add the method:
toSQL()
at the end
and then console log what it returnsThat is correct.
Are you sure that email exists in the database?
yes
The above query returns the existing emails in the DB
okay it works now, wierd
Anyways thanks man
Can you do
toSQL()
on that one to see?
Can you show the database definition
I meant the table definitionI can't find anything wrong with this setup
I guess the next step is creating a reproduction repo to investigate
This API is well tested, I doubt it's an issue with drizzle