mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-04-10 04:05:49 +00:00
fix Pool to remove possibility of "leaking" connections (#84)
* fix `Pool` to reduce possibility of "leaking" connections now uses RAII guards to control `SharedPool::size` * add smoke test for `Pool` to both Postgres and MySQL tests add `Pool::is_closed()` * fix documentation re: pool * refactor pool implementation to not use futures oneshot channels https://github.com/launchbadge/sqlx/pull/84#issuecomment-580476223 * run cargo fmt * Pool: remove superfluous guard struct, document some internal methods
This commit is contained in:
@@ -18,9 +18,9 @@ use crate::postgres::PgError;
|
||||
use crate::url::Url;
|
||||
use crate::Result;
|
||||
|
||||
/// An asynchronous connection to a [Postgres] database.
|
||||
/// An asynchronous connection to a [Postgres][super::Postgres] database.
|
||||
///
|
||||
/// The connection string expected by [Connection::open] should be a PostgreSQL connection
|
||||
/// The connection string expected by [Connect::connect] should be a PostgreSQL connection
|
||||
/// string, as documented at
|
||||
/// <https://www.postgresql.org/docs/12/libpq-connect.html#LIBPQ-CONNSTRING>
|
||||
///
|
||||
|
||||
@@ -16,5 +16,5 @@ mod protocol;
|
||||
mod row;
|
||||
mod types;
|
||||
|
||||
/// An alias for [`Pool`], specialized for **Postgres**.
|
||||
/// An alias for [`Pool`][crate::Pool], specialized for **Postgres**.
|
||||
pub type PgPool = super::Pool<PgConnection>;
|
||||
|
||||
Reference in New Issue
Block a user