Skip to content

pipelining in v0.1.0 #25

Answered by weiznich
davepacheco asked this question in Q&A
Sep 28, 2022 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Using pipelining to optimize transactions is one of the use cases for which this feature is designed. "independent queries" does refer here mostly to not allow the following constructs:

let id = users::table.filter(users::name.eq("John")).select(users::id).get_result(conn).await?;
diesel::update(posts::table.filter(users::id.eq(id))).set(posts::title.eq("John's posts").execute(conn).await?;

This is obviously not possible as the second query depends on inputs returned by the first query. Any query combination that does not need to use the results from previous queries can theoretically use pipelining.

  • the implementation guarantees that all queries will be issued on the same connection (w…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@davepacheco
Comment options

@weiznich
Comment options

Answer selected by davepacheco
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants