Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tokio-postgres: add execute_prepared function #991

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Feb 9, 2023

  1. tokio-postgres: add execute_prepared function

    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.
    mahkoh committed Feb 9, 2023
    Configuration menu
    Copy the full SHA
    e8b243b View commit details
    Browse the repository at this point in the history