Skip to content

Commit fe17f8e

Browse files
Drop support for simultaneous use of both sqlite and postgres DBs
1 parent 9e8ac65 commit fe17f8e

File tree

3 files changed

+0
-404
lines changed

3 files changed

+0
-404
lines changed

database/src/bin/ingest-json.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -600,13 +600,6 @@ async fn main() {
600600
Pool::Postgres(mut p) => {
601601
postgres = Some(p.raw().open().await.into());
602602
}
603-
Pool::Both {
604-
sqlite: mut s,
605-
postgres: mut p,
606-
} => {
607-
sqlite = Some(s.raw().open().await.into_inner().unwrap());
608-
postgres = Some(p.raw().open().await.into());
609-
}
610603
}
611604

612605
if let Some(s) = &mut sqlite {

database/src/pool.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use std::sync::{Arc, Mutex};
55
use std::time::Duration;
66
use tokio::sync::{OwnedSemaphorePermit, Semaphore};
77

8-
pub mod both;
98
pub mod postgres;
109
pub mod sqlite;
1110

@@ -160,43 +159,19 @@ where
160159
pub enum Pool {
161160
Sqlite(ConnectionPool<sqlite::Sqlite>),
162161
Postgres(ConnectionPool<postgres::Postgres>),
163-
Both {
164-
sqlite: ConnectionPool<sqlite::Sqlite>,
165-
postgres: ConnectionPool<postgres::Postgres>,
166-
},
167162
}
168163

169164
impl Pool {
170165
pub async fn connection(&self) -> Box<dyn Connection> {
171166
match self {
172167
Pool::Sqlite(p) => Box::new(sqlite::SqliteConnection::new(p.get().await)),
173168
Pool::Postgres(p) => Box::new(p.get().await),
174-
Pool::Both { sqlite, postgres } => Box::new(both::BothConnection::new(
175-
sqlite::SqliteConnection::new(sqlite.get().await),
176-
postgres.get().await,
177-
)),
178169
}
179170
}
180171

181172
pub fn open(uri: &str) -> Pool {
182173
if uri.starts_with("postgres") {
183174
Pool::Postgres(ConnectionPool::new(postgres::Postgres::new(uri.into())))
184-
} else if uri.starts_with("both://") {
185-
let mut parts = uri["both://".len()..].rsplitn(2, ';');
186-
let p1 = parts.next().unwrap();
187-
let p2 = parts.next().unwrap();
188-
match (Pool::open(p1), Pool::open(p2)) {
189-
(Pool::Sqlite(s), Pool::Postgres(p)) | (Pool::Postgres(p), Pool::Sqlite(s)) => {
190-
Pool::Both {
191-
sqlite: s,
192-
postgres: p,
193-
}
194-
}
195-
_ => panic!(
196-
"unsupported inputs, must be sqlite and postgres: {} and {}",
197-
p1, p2
198-
),
199-
}
200175
} else {
201176
Pool::Sqlite(ConnectionPool::new(sqlite::Sqlite::new(uri.into())))
202177
}

0 commit comments

Comments
 (0)