Skip to content

Commit 1819b98

Browse files
ViktorT-11ziggie1984
authored andcommitted
sqldb/v2: clarify config options docs
The documentation for the `SqliteConfig.MaxConnections`, `PostgresConfig.MaxOpenConnections` and `PostgresConfig.MaxIdleConnections` previously stated that an unlimited number was used when the value was set to 0. This is not the case however, as setting the value to 0 will result in the default values being used.
1 parent 58f757a commit 1819b98

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

sqldb/v2/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const (
3333
type SqliteConfig struct {
3434
Timeout time.Duration `long:"timeout" description:"The time after which a database query should be timed out."`
3535
BusyTimeout time.Duration `long:"busytimeout" description:"The maximum amount of time to wait for a database connection to become available for a query."`
36-
MaxConnections int `long:"maxconnections" description:"The maximum number of open connections to the database. Set to zero for unlimited."`
36+
MaxConnections int `long:"maxconnections" description:"The maximum number of open connections to the database."`
3737
PragmaOptions []string `long:"pragmaoptions" description:"A list of pragma options to set on a database connection. For example, 'auto_vacuum=incremental'. Note that the flag must be specified multiple times if multiple options are to be set."`
3838
SkipMigrations bool `long:"skipmigrations" description:"Skip applying migrations on startup."`
3939

@@ -75,8 +75,8 @@ func (p *SqliteConfig) Validate() error {
7575
type PostgresConfig struct {
7676
Dsn string `long:"dsn" description:"Database connection string."`
7777
Timeout time.Duration `long:"timeout" description:"Database connection timeout. Set to zero to disable."`
78-
MaxOpenConnections int `long:"maxconnections" description:"Max open connections to keep alive to the database server. Set to zero for unlimited."`
79-
MaxIdleConnections int `long:"maxidleconnections" description:"Max number of idle connections to keep in the connection pool. Set to zero for unlimited."`
78+
MaxOpenConnections int `long:"maxconnections" description:"Max open connections to keep alive to the database server."`
79+
MaxIdleConnections int `long:"maxidleconnections" description:"Max number of idle connections to keep in the connection pool."`
8080
ConnMaxLifetime time.Duration `long:"connmaxlifetime" description:"Max amount of time a connection can be reused for before it is closed. Valid time units are {s, m, h}."`
8181
ConnMaxIdleTime time.Duration `long:"connmaxidletime" description:"Max amount of time a connection can be idle for before it is closed. Valid time units are {s, m, h}."`
8282
RequireSSL bool `long:"requiressl" description:"Whether to require using SSL (mode: require) when connecting to the server."`

0 commit comments

Comments
 (0)