ts-sql-plugin icon indicating copy to clipboard operation
ts-sql-plugin copied to clipboard

sql.mock is not working while using separately

Open herenickname opened this issue 3 years ago • 0 comments

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",

herenickname avatar Oct 11 '22 06:10 herenickname