D1_ERROR: near \"ilike\":

Can anyone spot what I'm doing wrong? Drizzle:
export async function searchByFontFamilyName(db: DB, search: string) {
return db
.select({
family: table_fonts.family,
})
.from(table_fonts)
.where(
ilike(table_fonts.family, `%${search}%`), // search: "nato"
);
}
export async function searchByFontFamilyName(db: DB, search: string) {
return db
.select({
family: table_fonts.family,
})
.from(table_fonts)
.where(
ilike(table_fonts.family, `%${search}%`), // search: "nato"
);
}
Logs this output:
Query: select "family" from "fonts" where "fonts"."family" ilike ? -- params: ["%nato%"]
Query: select "family" from "fonts" where "fonts"."family" ilike ? -- params: ["%nato%"]
I get this error:
D1_ERROR: near \"ilike\": syntax error at offset 66
D1_ERROR: near \"ilike\": syntax error at offset 66
1 Reply
Matt
MattOP6mo ago
This seems to work if I use like over ilike Answer: SQLite doesn't support ilike and isn't case sensitive!
Want results from more Discord servers?
Add your server