diff --git a/Cargo.toml b/Cargo.toml index 0115efb..8f687dc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,14 +16,18 @@ default = [ "cockroach" ] [dependencies] bb8 = "0.8" async-trait = "0.1.73" -diesel = { version = "2.1.0", default-features = false, features = [ "r2d2" ] } +# FIXME before merging +# diesel = { version = "2.1.0", default-features = false, features = [ "r2d2" ] } +diesel = { git = "https://github.com/smklein/diesel.git", branch = "update_database_url", default-features = false, features = [ "r2d2" ] } futures = "0.3" thiserror = "1.0" tokio = { version = "1.32", default-features = false, features = [ "rt-multi-thread" ] } [dev-dependencies] anyhow = "1.0" -diesel = { version = "2.1.0", features = [ "postgres", "r2d2" ] } +# FIXME before merging +# diesel = { version = "2.1.0", features = [ "postgres", "r2d2" ] } +diesel = { git = "https://github.com/smklein/diesel.git", branch = "update_database_url", default-features = false, features = [ "r2d2" ] } libc = "0.2.150" tempfile = "3.8" tokio = { version = "1.32", features = [ "macros", "fs", "process" ] } diff --git a/src/connection_manager.rs b/src/connection_manager.rs index 5da755a..0b80b50 100644 --- a/src/connection_manager.rs +++ b/src/connection_manager.rs @@ -46,6 +46,10 @@ impl ConnectionManager { } } + pub fn update_database_url>(&self, database_url: S) { + self.inner.lock().unwrap().update_database_url(database_url) + } + async fn run_blocking(&self, f: F) -> R where R: Send + 'static,