Skip to content

Commit

Permalink
docs: Fix description of min_connections (launchbadge#2687)
Browse files Browse the repository at this point in the history
On `PoolOptions::connect()`, we open at least `min_connections`
connections, or 1 if unset. Therefore, the expression needs to be
`max()`. (`min(1, x)` would mean we always open only a single
connection).
  • Loading branch information
hakoerber committed Sep 12, 2023
1 parent c0d4019 commit 35ba8e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sqlx-core/src/pool/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ impl<DB: Database> PoolOptions<DB> {
///
/// This ensures the configuration is correct.
///
/// The total number of connections opened is <code>min(1, [min_connections][Self::min_connections])</code>.
/// The total number of connections opened is <code>max(1, [min_connections][Self::min_connections])</code>.
///
/// Refer to the relevant `ConnectOptions` impl for your database for the expected URL format:
///
Expand All @@ -486,7 +486,7 @@ impl<DB: Database> PoolOptions<DB> {
///
/// This ensures the configuration is correct.
///
/// The total number of connections opened is <code>min(1, [min_connections][Self::min_connections])</code>.
/// The total number of connections opened is <code>max(1, [min_connections][Self::min_connections])</code>.
pub async fn connect_with(
self,
options: <DB::Connection as Connection>::Options,
Expand Down

0 comments on commit 35ba8e2

Please sign in to comment.