porsager / porsager/postgres

Allow partial pipelining within a transaction

Open
#951 9 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

Allow pipelining the some requests in a transaction without requiring that all the requests are pipelined. This would allow selecting to get the id of a row, then issuing multiple statements based on the id of the row in a pipelined fashion.

For example:

await sql.begin(async sql => {
  const [movie] = await sql`
    SELECT * FROM Movie
    WHERE name = 'Star Wars'
  `;
  return [
    sql`
      INSERT INTO MovieActor
      -- some statement using ${movie.id}
    `,
    sql`
      INSERT INTO MovieReleases
      -- some statement using ${movie.id}
    `,
     // etc
  ]
})

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 at the transaction entry point shown in the issue, sql.begin, and trace how tagged sql requests are currently grouped and executed. Compare the existing all-pipelined behavior with the requested mix of an awaited result followed by pipelined statements; done means both sequential and pipelined requests work within one transaction.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, postgresql
Domain
database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.