ts-sql-plugin
ts-sql-plugin copied to clipboard
sql.mock is not working while using separately
Code:
const startDateSql = sql.mock<'2022-01-01T00:00:00.0Z'>(startDate.toISOString())
const endDateSql = sql.mock<'2023-01-01T00:00:00.0Z'>(endDate.toISOString())
const query = sql`
SELECT
${startDateSql}::timestamp with time zone AS "start",
${endDateSql}::timestamp with time zone AS "end"
...
`
ts-sql-plugin:
ERROR: cannot cast type integer to timestamp with time zone
LINE 3: 0::timestamp with time zone AS "start",