© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago•
2 replies
Will

How would you write this REPLACE query?

UPDATE Examples
SET prompt = REPLACE(prompt, 'textToReplaceFrom', 'textToReplaceWith')
WHERE id IN [array of ids];
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})`
 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.
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How would you write this SQL query using Drizzle?
Drizzle TeamDTDrizzle Team / help
16mo ago
Write SQL query in Drizzle?
Drizzle TeamDTDrizzle Team / help
2y ago
How do you compare counts in a query?
Drizzle TeamDTDrizzle Team / help
3y ago
how to model this query in drizzle
Drizzle TeamDTDrizzle Team / help
12mo ago