Support anonymous prepared statements in postgres #2470
robert-sjoblom
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As many others, we find ourselves behind an instance of PgBouncer, which makes sqlx less than ergonomic to work with. The issue stems from prepared statements. Turning off local statement cache doesn't help.
After some local testing, the following hack works across a pgbouncer connection:
Now, we cannot leave it like this, but at least we've established that anonymous prepared statements work in sqlx across a pgbouncer connection.
What's the way forward here? I'm relatively (extremely) new as a rust dev. Would a new option when initializing the connection be a good place to configure this?
anonymous_statements(true)
with a defaultfalse
? Such a configuration would, by necessity, also disable the local statement cache, too (I guess?) Is there anything I can do to help here? Would an issue be a good first step?And yes, I did open a QA thread that I somehow also closed. I don't tend to use github that often, and I still don't know quite what I did 😅
Beta Was this translation helpful? Give feedback.
All reactions