Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

tokio-postgres: addexecute_prepared function#991

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
mahkoh wants to merge1 commit intorust-postgres:master
base:master
Choose a base branch
Loading
frommahkoh:execute_prepared

Conversation

mahkoh
Copy link

@mahkohmahkoh commentedFeb 9, 2023
edited
Loading

As it says in the documentation:

This function is identical toexecute_raw except that:

  1. The returned future does not borrow the parameters orself.
  2. The type of the returned future does not depend on the parameters.
  3. If multiple such futures are being used concurrently, then they are
    executed on the server in the order in which this function was
    called, regardless of the order in which the futures are polled.
  4. This function can only be used with prepared statements.

This has the following additional advantages:

  1. Multiple non-homogeneousexecute futures can be stored in a collection without having to box the futures.
  2. The parameters can be temporaries that do not need to out-live the futures.
  3. We can rely on the order in which the futures reach the server without having to rely on polling order which might not always be documented.
  4. It is not necessary to poll the returned futures at all. An application can also only poll the final transaction commit.

gustav3d reacted with thumbs up emojigustav3d reacted with hooray emojigustav3d reacted with heart emojigustav3d and mymtw reacted with rocket emoji
As it says in the documentation:> This function is identical to `execute_raw` except that:>> 1. The returned future does not borrow the parameters or `self`.> 2. The type of the returned future does not depend on the parameters.> 3. If multiple such futures are being used concurrently, then they are>    executed on the server in the order in which this function was>    called, regardless of the order in which the futures are polled.> 4. This function can only be used with prepared statements.This has the following additional advantages:1. Multiple non-homogeneous `execute` futures can be stored in a   collection without having to box the futures.2. The parameters can be temporaries that do not need to out-live the   futures.3. We can rely on the order in which the futures reach the server   without having to rely on polling order which might not always be   documented.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@mahkoh

[8]ページ先頭

©2009-2025 Movatter.jp