diff --git a/src/lib.rs b/src/lib.rs index ee99dbc..a2d9b21 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -110,7 +110,7 @@ impl PoolBuilder { /// An asynchronous pool of SQLx database connections with tracing instrumentation. /// /// Wraps a SQLx [`Pool`] and propagates tracing attributes to all acquired connections. -#[derive(Clone, Debug)] +#[derive(Debug)] pub struct Pool where DB: sqlx::Database, @@ -119,6 +119,18 @@ where attributes: Arc, } +impl Clone for Pool +where + DB: sqlx::Database, +{ + fn clone(&self) -> Self { + Self { + inner: self.inner.clone(), + attributes: self.attributes.clone(), + } + } +} + impl From> for Pool where DB: sqlx::Database,