I don't think you understand what the code is doing. That's a string templating function, not a raw templated string. `${formData.get('name')}` will get passed as a parameter in a var-arg, not stuck straight into the string.
import { tableName } from "../shared"
sql`SELECT * FROM ${tableName} WHERE id=${formData.get('id')}`
The @vercel/postgres package needs a big disclaimer that it works very differently from node-postgres and what is and is not allowed.Also, node-postgres is ripe for sql injections because you just concatenate strings yourself when using it...
Why the heck would you do that?
I guess for any library that accepts SQL, someone might concatenate strings rather than use the parameter handling.
Not sure what ORMs have to do with it. They do include a safe parameter substitution mechanism, but so do typical SQL-based clients.