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"
    );
}

Logs this output:
Query: select "family" from "fonts" where "fonts"."family" ilike ? -- params: ["%nato%"]

I get this error:
D1_ERROR: near \"ilike\": syntax error at offset 66
Was this page helpful?