porsager / porsager/postgres

Interpolated named parameters for function calls

Open
#1,040 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
8.7k
Forks
374
Avg merge
11d 16h
Merged PRs (30d)
1

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how object interpolations are handled for inserts and updates, then compare that path with function-call interpolations. Use the PostgreSQL named-parameter syntax in the issue as the target, and verify that the example produces the corresponding name => value arguments.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, postgresql
Domain
database
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.