diff --git a/src/pooled_connection/bb8.rs b/src/pooled_connection/bb8.rs index f9fb8e4..8f5eba3 100644 --- a/src/pooled_connection/bb8.rs +++ b/src/pooled_connection/bb8.rs @@ -37,7 +37,10 @@ //! # async fn run_test() -> Result<(), Box> { //! # use schema::users::dsl::*; //! # let config = get_config(); -//! let pool = Pool::builder().build(config).await?; +//! # #[cfg(feature = "postgres")] +//! let pool: Pool = Pool::builder().build(config).await?; +//! # #[cfg(not(feature = "postgres"))] +//! # let pool = Pool::builder().build(config).await?; //! let mut conn = pool.get().await?; //! # conn.begin_test_transaction(); //! # create_tables(&mut conn).await; @@ -53,6 +56,9 @@ use bb8::ManageConnection; use diesel::query_builder::QueryFragment; /// Type alias for using [`bb8::Pool`] with [`diesel-async`] +/// +/// This is **not** equal to [`bb8::Pool`]. It already uses the correct +/// connection manager and expects only the connection type as generic argument pub type Pool = bb8::Pool>; /// Type alias for using [`bb8::PooledConnection`] with [`diesel-async`] pub type PooledConnection<'a, C> = bb8::PooledConnection<'a, AsyncDieselConnectionManager>; diff --git a/src/pooled_connection/deadpool.rs b/src/pooled_connection/deadpool.rs index d791bb9..3a8bfec 100644 --- a/src/pooled_connection/deadpool.rs +++ b/src/pooled_connection/deadpool.rs @@ -37,7 +37,10 @@ //! # async fn run_test() -> Result<(), Box> { //! # use schema::users::dsl::*; //! # let config = get_config(); -//! let pool = Pool::builder(config).build()?; +//! # #[cfg(feature = "postgres")] +//! let pool: Pool = Pool::builder(config).build()?; +//! # #[cfg(not(feature = "postgres"))] +//! # let pool = Pool::builder(config).build()?; //! let mut conn = pool.get().await?; //! # conn.begin_test_transaction(); //! # create_tables(&mut conn).await; @@ -51,6 +54,9 @@ use deadpool::managed::Manager; use diesel::query_builder::QueryFragment; /// Type alias for using [`deadpool::managed::Pool`] with [`diesel-async`] +/// +/// This is **not** equal to [`deadpool::managed::Pool`]. It already uses the correct +/// connection manager and expects only the connection type as generic argument pub type Pool = deadpool::managed::Pool>; /// Type alias for using [`deadpool::managed::PoolBuilder`] with [`diesel-async`] pub type PoolBuilder = deadpool::managed::PoolBuilder>; diff --git a/src/pooled_connection/mobc.rs b/src/pooled_connection/mobc.rs index 5835a25..22beb0f 100644 --- a/src/pooled_connection/mobc.rs +++ b/src/pooled_connection/mobc.rs @@ -37,7 +37,10 @@ //! # async fn run_test() -> Result<(), Box> { //! # use schema::users::dsl::*; //! # let config = get_config(); -//! let pool = Pool::new(config); +//! # #[cfg(feature = "postgres")] +//! let pool: Pool = Pool::new(config); +//! # #[cfg(not(feature = "postgres"))] +//! # let pool = Pool::new(config); //! let mut conn = pool.get().await?; //! # conn.begin_test_transaction(); //! # create_tables(&mut conn).await; @@ -51,6 +54,10 @@ use diesel::query_builder::QueryFragment; use mobc::Manager; /// Type alias for using [`mobc::Pool`] with [`diesel-async`] +/// +/// +/// This is **not** equal to [`mobc::Pool`]. It already uses the correct +/// connection manager and expects only the connection type as generic argument pub type Pool = mobc::Pool>; /// Type alias for using [`mobc::Connection`] with [`diesel-async`]