We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
connect_now()
1 parent e433360 commit 0e29b79Copy full SHA for 0e29b79
src/db.rs
@@ -56,11 +56,8 @@ impl Deref for DieselPooledConn<'_> {
56
}
57
58
pub fn connect_now() -> ConnectionResult<PgConnection> {
59
- let mut url = Url::parse(&crate::env("DATABASE_URL")).expect("Invalid database URL");
60
- if dotenv::var("HEROKU").is_ok() && !url.query_pairs().any(|(k, _)| k == "sslmode") {
61
- url.query_pairs_mut().append_pair("sslmode", "require");
62
- }
63
- PgConnection::establish(&url.to_string())
+ let url = connection_url(&crate::env("DATABASE_URL"));
+ PgConnection::establish(&url)
64
65
66
pub fn connection_url(url: &str) -> String {
0 commit comments