Open kronos-999 opened 8 months ago
Hello, I am trying to implement query fragments as described in your dynamic query section. I have the following:
const results = await sql` SELECT * FROM schema.table WHERE shorts_availabilities && ARRAY[${body.timespan}]::date[] ${body.areas !== 0 ? sql`AND areas && ARRAY[${body.area}]::INTEGER[]` : sql``} `
I get a syntax error at "AND"
I think you might need to change && to AND
&&
AND
Hello, I am trying to implement query fragments as described in your dynamic query section. I have the following:
I get a syntax error at "AND"