sql operator with array of strings
This works
This also works
This crashes
Is there any workaround to pass an array in the sql operator?
This also works
This crashes
Is there any workaround to pass an array in the sql operator?
const example = await db
.select({
col: sql`ARRAY['1', '2', '3']`,
})
.from(users)
.limit(1)const example = await db
.select({
col: sql`ARRAY['1', '2', '3'] @> ARRAY['1', '2']`,
})
.from(users)
.limit(1) const example = await db
.select({
col: sql`ARRAY['1', '2', '3'] @> ${["1", "2"]}`,
})
.from(users)
.limit(1)