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).
This commit is contained in:
Hannes Körber
2023-09-12 04:28:54 +02:00
committed by GitHub
parent c0d4019d17
commit 35ba8e2b93

View File

@@ -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:
///
@@ -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,