othman
othman
DTDrizzle Team
Created by othman on 7/18/2024 in #help
Drizzle ORM Query Builder Only Returning One Row
Aren't these two queries the same?
const [data] = await db.execute(sql`SELECT * FROM products`);
const [data] = await db.execute(sql`SELECT * FROM products`);
const [data] = await db.select().from(products);
const [data] = await db.select().from(products);
I'm trying to fetch all rows from the products table. Raw SQL query execution works fine and returns all rows:
db.execute(sqlSELECT * FROM products)
db.execute(sqlSELECT * FROM products)
But using the standalone query builder, only one row is returned:
db.select().from(products)
db.select().from(products)
Do I miss something here? I'm using MySQL with Next.js
3 replies