Closed sgrif closed 6 years ago
This is a reasonable place to ask! The analogous function would just I think be
pub fn diesel_pool(
url: &str,
builder: r2d2::Builder<ConnectionManager>,
) -> DieselPool {
let mut url = Url::parse(url).expect("Invalid database URL");
if env::var("HEROKU").is_ok() && !url.query_pairs().any(|(k, _)| k == "sslmode") {
url.query_pairs_mut().append_pair("sslmode", "require");
}
let manager = ConnectionManager::new(url.into_string());
builder.build(manager).unwrap()
}
You can also use build_unchecked to avoid the unwrap if you'd like.
I'll give that a try, thanks!
Sorry to ask here, I'm not sure where a better place to ask is (there's no IRC or gitter link in the README)... crates.io has this function which I am completely stumped on how to migrate to 0.8.0. Any help would be appreciated.