-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
How to store and use values made during on_acquire? #110
Comments
Maybe you should write your own |
(If it's generic enough I'd be happy to accept it into bb8-postgres and maintain it.) |
film42
added a commit
to film42/bb8
that referenced
this issue
Oct 24, 2021
With this example we show how easy it is to wrap the postgres connection pool to prepare several queries when a connection is created. Then, once a connection is checked out, this examples shows how easy it is to use the custom state to pull a prepared statement. Inspired by djc#110 which requests this kind of behavior in bb8 directly, but for now it's easy to extend any connection manager with your custom needs.
film42
added a commit
to film42/bb8
that referenced
this issue
Oct 27, 2021
With this example we show how easy it is to wrap the postgres connection pool to prepare several queries when a connection is created. Then, once a connection is checked out, this examples shows how easy it is to use the custom state to pull a prepared statement. Inspired by djc#110 which requests this kind of behavior in bb8 directly, but for now it's easy to extend any connection manager with your custom needs.
djc
pushed a commit
that referenced
this issue
Oct 28, 2021
With this example we show how easy it is to wrap the postgres connection pool to prepare several queries when a connection is created. Then, once a connection is checked out, this examples shows how easy it is to use the custom state to pull a prepared statement. Inspired by #110 which requests this kind of behavior in bb8 directly, but for now it's easy to extend any connection manager with your custom needs.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have the following code:
I want to prepare a number of queries using this for every connection. However, I'm struggling to think of a way to actually get the reference to the prepared statements for a specific connection. Is there a way to bind some data to the connection object, or at least a way to get some unique identifier for a connection that I could use to lookup their prepared statements in a hash table?
The text was updated successfully, but these errors were encountered: