In plain words
SQL injection happens when your code glues user text into a database query, so carefully crafted text changes the query itself and reads or deletes data it shouldn't.
Where you see it
Harbor's search box drops whatever you type into a raw Postgres query. Typing ' OR '1'='1 turns "find my server" into "find every server". Supabase's client and ORMs like Prisma and Drizzle prevent this, until someone writes SQL as a string by hand.
What goes wrong
- Building queries with template strings
Anything inside ${} lands straight in the SQL. Use placeholders like $1, or let the query builder fill values in.
- Reaching for the unsafe escape hatch
Prisma's $queryRawUnsafe and Drizzle's sql.raw exist for rare cases. Agents use them to get a tricky query working, and the protection goes with them.
- Letting users pick column names
Placeholders protect values, not column or table names. If users choose the sort column, check it against a fixed list.
What to tell your agent
Quick check
Sign in to earn +10 XP for itQuickBite loads orders with supabase.from("orders").select().eq("id", id). Is that open to SQL injection?