Motivation
Currently the PostgreSQL retriever supports basic connection settings such as the uri, table, and custom column names. However, it doesn’t provide user-configurable settings for connection pooling (max connections, idle connections, connection lifetimes, timeouts, etc.).
For many production workloads, especially under high concurrency or when using managed cloud Postgres instances, having control over these pool settings is essential for performance, stability, and resource efficiency.
Requirements
Allow users to configure PostgreSQL connection pool parameters when using the postgresql retriever, instead of relying solely on driver defaults.
The configuration must:
- Add an optional pool section under the PostgreSQL retriever configuration.
- Map configuration values to the underlying Go database/sql pool settings - (
MaxOpenConns, MaxIdleConns, ConnMaxLifetime, ConnMaxIdleTime)
- If pool is not defined, current behavior and defaults must remain unchanged.
- Validate configuration values
Proposed solution:
Introduce optional PostgreSQL retriever configuration properties for pool management. For example:
retrievers:
- kind: postgresql
uri: "postgres://user:pass@host/db"
table: "go_feature_flag"
pool:
max_open_conns: 50
max_idle_conns: 10
conn_max_lifetime: "30m"
conn_max_idle_time: "10m"
Motivation
Currently the PostgreSQL retriever supports basic connection settings such as the
uri,table, and custom column names. However, it doesn’t provide user-configurable settings for connection pooling (max connections, idle connections, connection lifetimes, timeouts, etc.).For many production workloads, especially under high concurrency or when using managed cloud Postgres instances, having control over these pool settings is essential for performance, stability, and resource efficiency.
Requirements
Allow users to configure PostgreSQL connection pool parameters when using the postgresql retriever, instead of relying solely on driver defaults.
The configuration must:
MaxOpenConns,MaxIdleConns,ConnMaxLifetime,ConnMaxIdleTime)Proposed solution:
Introduce optional PostgreSQL retriever configuration properties for pool management. For example: