Skip to content

Allow partial pipelining within a transaction #951

Open
@astralarya

Description

@astralarya

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
  ]
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions