You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Cloud Run + Cloud SQL (postgres) and the connection string which worked with diesel does not work out of the box with sqlx. I format it like this:
//note: things in all caps, that aren't env vars, are configurable / global constantslet socket_path = std::env::var("DB_SOCKET_PATH").unwrap_or("/cloudsql".to_string());let instance_connection = std::env::var("INSTANCE_CONNECTION_NAME").unwrap_or(MY_INSTANCE_NAME.to_string());let full_socket_path = utf8_percent_encode(&format!("{}/{}", socket_path, instance_connection),NON_ALPHANUMERIC).to_string();format!("postgres://{}:{}@{}/{}", DB_USER, DB_PASS, full_socket_path, DB_NAME);
Any tips appreciated! I haven't tried the PgConnectOptions approach yet
The text was updated successfully, but these errors were encountered:
Picking up from #144 (comment)
I am using Cloud Run + Cloud SQL (postgres) and the connection string which worked with diesel does not work out of the box with sqlx. I format it like this:
Any tips appreciated! I haven't tried the
PgConnectOptions
approach yetThe text was updated successfully, but these errors were encountered: