postgres
postgres copied to clipboard
Interpolated named parameters for function calls
Postgres supports calling functions using a "named parameter" notation since (it looks like) version 13: 4.3. Calling Functions.
This is a feature request to support named parameters in interpolations when an object is passed as an argument, similarly to inserts and updates.
E.g.,
const params = { name: 'John', age: 34 }
sql`SELECT my_func(${sql(params)});`
would correspond to
SELECT my_func(name => 'John', age => 34);