From 35ba8e2b93f085bbd3b40d31c2f7b01a9911a9de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Tue, 12 Sep 2023 04:28:54 +0200 Subject: [PATCH] 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). --- sqlx-core/src/pool/options.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sqlx-core/src/pool/options.rs b/sqlx-core/src/pool/options.rs index 970b8fccd..a15ceb40b 100644 --- a/sqlx-core/src/pool/options.rs +++ b/sqlx-core/src/pool/options.rs @@ -470,7 +470,7 @@ impl PoolOptions { /// /// This ensures the configuration is correct. /// - /// The total number of connections opened is min(1, [min_connections][Self::min_connections]). + /// The total number of connections opened is max(1, [min_connections][Self::min_connections]). /// /// Refer to the relevant `ConnectOptions` impl for your database for the expected URL format: /// @@ -486,7 +486,7 @@ impl PoolOptions { /// /// This ensures the configuration is correct. /// - /// The total number of connections opened is min(1, [min_connections][Self::min_connections]). + /// The total number of connections opened is max(1, [min_connections][Self::min_connections]). pub async fn connect_with( self, options: ::Options,