sql escaping on where
Trying to do the following:
But it breaks on the secon unaccent with
could not determine data type of parameter $1
. What am I missing? 🤔2 Replies
I "solved" it by using:
A bit worried about using
raw
Now using:
ran into a simillar issue where im conditionaly building the where clause
where.push(
sql
CONCAT(${users.firstName},' ', ${users.lastName}) ILIKE '%${name}%'
,
);
this throws a bind message error
you can build the string like this, where your adding the % within the interpolation
sql`CONCAT(${users.firstName},' ', ${users.lastName}) ILIKE ${'%' + pageOptionsDto.name + '%'}