Getting syntax error when using the sql operator (pg)

Trying to execute this line of code:
await db.execute(sql`SET db.tenant_id = ${tenantId};`);

the query that is produced by drizzle:
Query: SET db.tenant_id = $1; -- params: ["2"]

and getting this error:
PostgresError: syntax error at or near "$1"


No idea why, any insight would be appreciated!
Was this page helpful?