Skip to content

Commit 35ba8e2

Browse files
authored
docs: Fix description of min_connections (#2687)
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).
1 parent c0d4019 commit 35ba8e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sqlx-core/src/pool/options.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ impl<DB: Database> PoolOptions<DB> {
470470
///
471471
/// This ensures the configuration is correct.
472472
///
473-
/// The total number of connections opened is <code>min(1, [min_connections][Self::min_connections])</code>.
473+
/// The total number of connections opened is <code>max(1, [min_connections][Self::min_connections])</code>.
474474
///
475475
/// Refer to the relevant `ConnectOptions` impl for your database for the expected URL format:
476476
///
@@ -486,7 +486,7 @@ impl<DB: Database> PoolOptions<DB> {
486486
///
487487
/// This ensures the configuration is correct.
488488
///
489-
/// The total number of connections opened is <code>min(1, [min_connections][Self::min_connections])</code>.
489+
/// The total number of connections opened is <code>max(1, [min_connections][Self::min_connections])</code>.
490490
pub async fn connect_with(
491491
self,
492492
options: <DB::Connection as Connection>::Options,

0 commit comments

Comments
 (0)