Normal boolean conditions

Hello,

i want to achieve the following:

  const record = await drizzle(c.env.DATABASE)
    .select()
    .from(dataProject)
    .where(and(eq(dataProject.id, id), and(eq(dataProject.userId, user.id), user.role == "manager")))
    .limit(1);


Show everything for managers (user is an object outside of drizzle) or the records where the userId is the current users id.

the user.role == "manager" part doesnt work. is there a alternative for this without unnecessary if statements?

Thanks yall
Was this page helpful?