-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Named prepared statements not working #239
Comments
Got it thanks! We will fix! |
I think possibly related, but I too am using rust but with The error shows in both cases when I use |
- when running a query, I get: ``` ...webapp::router: search failed: error returned from database: prepared statement "sqlx_s_2" does not exist ``` - this looks similar to this issue: supabase/supavisor#239 (just opened a couple of weeks ago)
We're using Ecto with elixir and running into the exact same issue where the client is complaining the the number of parameters submitted differed from what was required. |
This is a critical fix before you switch to Supavisor. Same issue when connecting from Kotlin based Spring apps. |
Same for Postgraphile. |
Same thing here with INITIALIZING DB PROVIDER |
+1 on this issue with sqlx with the new connection pooler db url |
any updates on this? |
I am also using sqlx and getting the above error. Has anyone identified a workaround, besides switching from |
I actually misunderstood the issue here. The Postgres driver for sqlx requires named prepared statements for nearly all queries, whether they are executed with the
I have all this code I've written with my local database which I now can't use to push data to my production Supabase instance. |
Quick update from @chasers via Twitter:
And indeed, if you switch from port 6543 to port 5432, the named prepared statements will work and sqlx will happily use a hosted Supabase instance. Thanks very much for the workaround! |
While switching to session mode does function as a workaround, it introduces challenges in scaling a micro-service or serverless based application. Given that pgbouncer added support for named statements in transaction mode in version 1.21.0, is there a roadmap or discussion regarding adding similar support in Supavisor? |
Okay, the reason this does not work, even though supavisor advertises prepared statement support is that it only supports SQL level prepared statements ( Every client I know of uses protocol level prepared statements, not SQL level prepared statements. So it's expected that transaction pooling doesn't work if your client uses prepared statements. The only time when SQL level prepared statements are used is usually in interactive applications. |
Bug report
Describe the bug
Rust's sqlx requires connection pooler to support named prepared statements in order to work properly, it has always been an issue up until the release of pgcat, that finally people can use it with a proper connection pooler, since #69 is closed I assume the latest release v1.0.0 for supavisor has been deployed for all Supabase users, however I did a test and sqlx still doesn't work and is due to named prepared statements.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Clone the supavisor-sqlx and replace the
DATABASE_URL
in.env
, you should see this error.Expected behavior
Expect named prepared statements to work with sqlx
The text was updated successfully, but these errors were encountered: