-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Escape PostgreSQL options #3800
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
base: main
Are you sure you want to change the base?
Conversation
This is technically a breaking behavior change as well, because anyone who's already manually escaping options will get different, likely incorrect, results after this patch. This should also document that the strings will be escaped: sqlx/sqlx-postgres/src/options/mod.rs Lines 496 to 504 in e474be6
Alternatively, we don't do this internally but instead expose |
Co-authored-by: Austin Bonander <[email protected]>
This would leak implementation details and keep a foot gun around, so I’d caution against that. |
If you're fine waiting for this to hit 0.9.0, then it doesn't matter. |
Properly escape PostgreSQL options containing spaces and backslash characters as specified under https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-OPTIONS.
Fixes #2027
Is this a breaking change?
No, this change fixes behavior that I consider a minor edge case.Yes,