How would you write this REPLACE query?

UPDATE Examples
SET prompt = REPLACE(prompt, 'textToReplaceFrom', 'textToReplaceWith')
WHERE id IN [array of ids];


I'm trying something like this:

 await db.execute(
sql`UPDATE ${examplesTable} SET prompt = REPLACE(${
  examplesTable.prompt
}, ${replaceTextFrom}, ${replaceTextTo}) WHERE ${
  examplesTable.id
} IN (${selected.included})`

but am getting this error: NeonDbError: db error: ERROR: argument of WHERE must be type boolean, not type record

I don't really understand why the where is not type boolean here because I'm using an IN statement.
Was this page helpful?