sql placeholder with an array throws an error

when executing this code:
const prepQuery = db
  .select()
  .from(table)
  .where(inArray(table.postId, sql.placeholder("postIds")))
  .prepare("prepquery");

const result = await prepQuery.execute({
  postIds: ["esaeasdas", "esaeasdas", "esaeasdas"]
})

Drizzle throws an error: syntax error at or near \"$1\. The code works when I execute the prepared query without the sql.placeholder, hardcoding an argument inside prepQuery
  • the error is not reproduced anyway else. Do I need to pass the array of strings there differently? I tried converting it into a string, but that does not work neither.
Was this page helpful?