I'm attempting to use the Postgres driver for SQLx to connect to a hosted CockroachDB. Due to the server implementation, the connection requires passing in some custom parameters, so the connection string looks like this:
let pool = PgPool::connect(
"postgres://user:pass@free-tier.gcp-us-central1.cockroachlabs.cloud:26257/db?options=--cluster%3Dmy-serverless-db-1234"
).await?;
Based on the error I get back (Error: error returned from database: codeParamsRoutingFailed: missing cluster name in connection string), it seems like SQLx is dropping the unknown options param from the query string because it's unrecognized.
Is there a good workaround for this presently or would we need to add support for an arbitrary map of options when connection?
I'm attempting to use the Postgres driver for SQLx to connect to a hosted CockroachDB. Due to the server implementation, the connection requires passing in some custom parameters, so the connection string looks like this:
Based on the error I get back (
Error: error returned from database: codeParamsRoutingFailed: missing cluster name in connection string), it seems like SQLx is dropping the unknownoptionsparam from the query string because it's unrecognized.Is there a good workaround for this presently or would we need to add support for an arbitrary map of options when connection?