Unexpected error on sql tagged template string

This issue has been tracked since 2022-11-10.

Describe the bug
SafeQL throws multiple errors when using the sql tagged template string on Postgres, which leads to the errors below
Invalid Query: the type "string | PendingQuery<Row[]>" is not supported and Invalid Query: Error: syntax error at or near "DEFAULT" The query below will throw the above errors

export async function query(a: number, b: string, c: string) {
  return await sql`
    UPDATE
      try_safe_ql
    SET
      b = ${b},
      c = ${c || sql`DEFAULT`}
    WHERE
      a = ${a}
  `;
}

To Reproduce
Steps to reproduce the behavior:

  1. Setup SafeQL
  2. Use this code in .ts file
export async function query(a: number, b: string, c: string) {
  return await sql`
    UPDATE
      try_safe_ql
    SET
      b = ${b},
      c = ${c || sql`DEFAULT`}
    WHERE
      a = ${a}
  `;
}

Expected behavior
There shouldn't be an error when using sql tagged template string
**
Screenshot 2022-11-10 at 13 31 01
Screenshot 2022-11-10 at 12 41 14
Screenshots**

Desktop (please complete the following information):

  • OS: MAC OS
  • PostgreSQL version 14
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

More Details About Repo
Owner Name ts-safeql
Repo Name safeql
Full Name ts-safeql/safeql
Language TypeScript
Created Date 2022-09-08
Updated Date 2023-03-16
Star Count 795
Watcher Count 5
Fork Count 14
Issue Count 7

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date