Guys, is there a way I can add where: eq(users.email, email) to a findFirst query in DrizzleOrm?

I currently do it like this
No description
10 Replies
Slavi
SlaviOP6mo ago
I am getting null
Slavi
SlaviOP6mo ago
No description
Slavi
SlaviOP6mo ago
oh, TypeError: Cannot read properties of undefined (reading 'findFirst')
Slavi
SlaviOP6mo ago
No description
Slavi
SlaviOP6mo ago
these are the relations hmm I even made the db with the schema as a type to get the relations export const db = drizzle<typeof schema>(client); Do you know what might be causing the error? @Vincent
Vincent Udén
Vincent Udén6mo ago
Your db.query.users is somehow undefined So I would start by checking the defninitions in db/index
Slavi
SlaviOP6mo ago
kk oh wait maybe I need to generate the schema first But I think I already did that
Vincent Udén
Vincent Udén6mo ago
Well if you made any changes you do have to regenerate it Im pretty sure
Slavi
SlaviOP6mo ago
yeah I think that is only for pushing the changes after to the db
Want results from more Discord servers?
Add your server