postgres icon indicating copy to clipboard operation
postgres copied to clipboard

Interpolated named parameters for function calls

Open ferdv opened this issue 8 months ago • 6 comments

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

ferdv avatar Mar 03 '25 19:03 ferdv