db.select returning [], but a directly executed neon sql statement returns data.
Hi, here is my code.
export const getData = async () => {
console.log("neon", await sql_neon
SELECT * FROM todo WHERE id = ${1});
console.log("drizzle", await db.select().from(todo));
};
Here is the console output on the server:
neon [ { id: 1, text: 'asdf', done: true } ]
Query: select "id", "text", "done" from "todo"
drizzle []
The second line is from the drizzle debugger. I'm really confused about what's going on. I am using the default code from the nextjs neon todo from the docs. I can successfully insert, but can't select anything. I've been left scratching my head and have no clue why this is happening. Thanks for any help.0 Replies