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
Slavi5mo ago
I am getting null
Slavi
Slavi5mo ago
No description
Slavi
Slavi5mo ago
oh, TypeError: Cannot read properties of undefined (reading 'findFirst')
Slavi
Slavi5mo ago
No description
Slavi
Slavi5mo 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én5mo ago
Your db.query.users is somehow undefined So I would start by checking the defninitions in db/index
Slavi
Slavi5mo ago
kk oh wait maybe I need to generate the schema first But I think I already did that
Vincent Udén
Vincent Udén5mo ago
Well if you made any changes you do have to regenerate it Im pretty sure
Slavi
Slavi5mo ago
yeah I think that is only for pushing the changes after to the db
Want results from more Discord servers?
Add your server