"bind message supplies 1 parameters, but prepared statement \"\" requires 0"

const results = await drizzleDb
.select({ count: sql<number>`count(*)` })
.from(calls)
.where(
sql`${calls.accountSid} = '${accountSid}' AND (${calls.createdAt} AT TIME ZONE 'EST')::date = current_date`
);
const results = await drizzleDb
.select({ count: sql<number>`count(*)` })
.from(calls)
.where(
sql`${calls.accountSid} = '${accountSid}' AND (${calls.createdAt} AT TIME ZONE 'EST')::date = current_date`
);
throw: "bind message supplies 1 parameters, but prepared statement \"\" requires 0" It looks to me like accountSid is a parameter that's needed, but not sure why this isn't working.
1 Reply
Dan
Dan2y ago
try enabling the query logging and checking what is the executed query
Want results from more Discord servers?
Add your server