sql operator with array of strings

This works
const example = await db
  .select({
    col: sql`ARRAY['1', '2', '3']`,
  })
  .from(users)
  .limit(1)


This also works
const example = await db
  .select({
    col: sql`ARRAY['1', '2', '3'] @> ARRAY['1', '2']`,
  })
  .from(users)
  .limit(1)


This crashes
  const example = await db
    .select({
      col: sql`ARRAY['1', '2', '3'] @> ${["1", "2"]}`,
    })
    .from(users)
    .limit(1)


Is there any workaround to pass an array in the sql operator?
Was this page helpful?