ocelot2123
ocelot2123
Explore posts from servers
TTCTheo's Typesafe Cult
Created by ocelot2123 on 4/4/2024 in #questions
Drizzle Mysql compare json arrays
I have a column that is a json of array of fileURLs (string). I'm trying to query based on array of urls as input like this:
// table schema
fileURLs: json("fileURLs").$type<string[]>().notNull(),

const fileURLs: string[];
await db.query.table.findFirst({
where: and(
eq(table.fileURLs, fileURLs),
)
)
// table schema
fileURLs: json("fileURLs").$type<string[]>().notNull(),

const fileURLs: string[];
await db.query.table.findFirst({
where: and(
eq(table.fileURLs, fileURLs),
)
)
but its unable to find a object, how should I approach with querying mysql jsons with drizzle? Should I just use raw sql?
6 replies