sqlx icon indicating copy to clipboard operation
sqlx copied to clipboard

`PgConnectOptions.options` are not URL encoded

Open rudolphfroger-ds opened this issue 3 years ago • 0 comments

https://github.com/launchbadge/sqlx/blob/728717f032675a1dbf0fc29246d8c047cbb3933b/sqlx-core/src/postgres/options/mod.rs#L431

Test case:

let pg_connect_opts = PgConnectOptions::default()
    .database(db_name)
    .options([("default_transaction_isolation", "repeatable read")]);

Connecting with these options will given an error that "repeatable" is not a valid isolation level.

I think the solution is to URL encode options.

rudolphfroger-ds avatar Aug 05 '22 12:08 rudolphfroger-ds