jivan
jivan
DTDrizzle Team
Created by jivan on 5/19/2023 in #help
Conditional logic within template strings not supported on raw MySQL query
I was able to convert the above query to drizzle with your example. Thank you for your help.
15 replies
DTDrizzle Team
Created by jivan on 5/19/2023 in #help
Conditional logic within template strings not supported on raw MySQL query
Yeah, it works, but fails with any conditional logic in it.
15 replies
DTDrizzle Team
Created by jivan on 5/19/2023 in #help
Conditional logic within template strings not supported on raw MySQL query
Will try it out and let you know.
const sqlQuery = `SELECT COUNT(*) as total FROM te_tenants WHERE 1 = 1;`;
const [res] = await db.execute(sql`${sqlQuery}`);
const sqlQuery = `SELECT COUNT(*) as total FROM te_tenants WHERE 1 = 1;`;
const [res] = await db.execute(sql`${sqlQuery}`);
Something this simple is also failing. I am using deno, so maybe something to do with mysql driver. But, I haven't tested it with node.
15 replies
DTDrizzle Team
Created by jivan on 5/19/2023 in #help
Conditional logic within template strings not supported on raw MySQL query
That would be great. I didn't find a way to convert the above query into drizzle. Could you also please tell me why the above fails as I will be doing a lot of raw queries in the future. Really appreciate your quick reply. Thanks, man.
15 replies