We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
connect_now()
1 parent 84b62a4 commit 8a950daCopy full SHA for 8a950da
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