Skip to content

Commit 825a8ad

Browse files
committed
store: Remove support for synchronous connections
1 parent 13bfeda commit 825a8ad

File tree

3 files changed

+1
-58
lines changed

3 files changed

+1
-58
lines changed

store/postgres/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ pub use self::detail::DeploymentDetail;
6262
pub use self::jobs::register as register_jobs;
6363
pub use self::notification_listener::NotificationSender;
6464
pub use self::pool::{
65-
AsyncConnection, AsyncPgConnection, ConnectionPool, ForeignServer, PgConnection,
66-
PoolCoordinator, PoolRole, ScopedFutureExt,
65+
AsyncPgConnection, ConnectionPool, ForeignServer, PoolCoordinator, PoolRole, ScopedFutureExt,
6766
};
6867
pub use self::primary::{db_version, UnusedDeployment};
6968
pub use self::store::Store;

store/postgres/src/pool/async_txn.rs

Lines changed: 0 additions & 46 deletions
This file was deleted.

store/postgres/src/pool/mod.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,19 @@ use crate::catalog;
2626
use crate::primary::{self, Mirror, Namespace};
2727
use crate::{Shard, PRIMARY_SHARD};
2828

29-
mod async_txn;
3029
mod coordinator;
3130
mod foreign_server;
3231
mod state_tracker;
3332

3433
pub use diesel_async::scoped_futures::ScopedFutureExt;
3534

36-
pub use async_txn::AsyncConnection;
3735
pub use coordinator::PoolCoordinator;
3836
pub use foreign_server::ForeignServer;
3937
use state_tracker::{ErrorHandler, EventHandler, StateTracker};
4038

4139
type AsyncPool = mobc::Pool<diesel_async::AsyncPgConnection>;
4240
/// A database connection for asynchronous diesel operations
4341
pub type AsyncPgConnection = mobc::PooledConnection<diesel_async::AsyncPgConnection>;
44-
/// A database connection for 'classic' synchronous diesel operations
45-
pub type PgConnection = AsyncConnectionWrapper<AsyncPgConnection>;
4642

4743
/// The namespace under which the `PRIMARY_TABLES` are mapped into each
4844
/// shard
@@ -321,12 +317,6 @@ impl ConnectionPool {
321317
self.get_ready()?.get().await
322318
}
323319

324-
/// An async version of `get`. For now, this calls `get` synchronously.
325-
/// Once `get` is not used anymore, we can make it truly async.
326-
pub async fn get_sync(&self) -> Result<PgConnection, StoreError> {
327-
self.get().await.map(AsyncConnectionWrapper::from)
328-
}
329-
330320
/// Get a connection from the pool for foreign data wrapper access;
331321
/// since that pool can be very contended, periodically log that we are
332322
/// still waiting for a connection

0 commit comments

Comments
 (0)