DT
Drizzle Team•9mo ago
Jure

MySQL select().from() type

Hi. I'm using Drizzle ORM in the Nuxt app where return type of the server is inferred to the frontend. This works with SQLite: db.select().from(models.users).all() But not with MySQL: db.select().from(models.users) Maybe it's a noob question, but how could I get the same return type with MySQL? I guess .all() do all the magic but there isn't such method using MySQL driver.
No description
No description
1 Reply
Jure
JureOP•9mo ago
I need such "return" type: [] | Promise<{ row object }> Not MySqlSelectBase. const users = await db.select().from(models.users).execute() .execute() fixed the problem 🙂 ----- const users = await db.select().from(models.users).execute() .execute() fixed the problem 🙂
Want results from more Discord servers?
Add your server