Skip to content

Commit

Permalink
introduce public Connection type (alias)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkusa committed Feb 3, 2024
1 parent 16b2ae8 commit a90a48d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion postgres/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ pub use types::SqlType;

static POOL: OnceCell<Pool> = OnceCell::new();

pub type Connection = Object;

#[tracing::instrument]
pub async fn connect() -> Result<Object, Error> {
pub async fn connect() -> Result<Connection, Error> {
// Don't trace connect, as this would create an endless loop of connecting again and
// again when persisting the connect trace!
let pool = POOL.get_or_try_init(|| {
Expand Down

0 comments on commit a90a48d

Please sign in to comment.