You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds support for configuring the maximum number of idle connections in the PostgreSQL connection pool.
Changes
Added MaxIDleConns field to the Config struct
Configured SetMaxIdleConns on the database connection using the new parameter
Allows better control over connection pool behavior and resource management
Context
This enhancement provides more flexibility in managing database connections, particularly useful for optimizing performance in huge ressources contexts
@jBouyoud Could you rebase your PR on main please (I can't do it with the UI, you probably didn't allow update by maintainer) so I can trigger the tests
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new provider configuration option to control the PostgreSQL connection pool’s maximum idle connections, wiring it from Terraform schema into the internal client configuration and documenting the new argument.
Changes:
Added a max_idle_connections provider argument and plumbed it into the provider configuration.
Extended the internal Config to carry the idle-connection limit and applied it via db.SetMaxIdleConns(...).
Updated website documentation to describe the new setting.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
File
Description
website/docs/index.html.markdown
Documents the new max_idle_connections provider argument and its default/semantics.
postgresql/provider.go
Adds the new schema field and passes it into the provider Config during configuration.
postgresql/config.go
Adds the new Config field and applies it to the *sql.DB pool via SetMaxIdleConns.
Hi @cyrilgdn 👋 I've rebased this PR onto the latest main (v1.27.0) — conflict-free and mergeable. I also addressed the Copilot review comments: fixed the MaxIdleConns typo, clarified the schema description/docs, and added a unit test for the mapping. Local go build/go vet/unit tests pass; the CI workflows are waiting for your approval to run. Could you take a look when you have a moment? Thanks a lot for maintaining this provider!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for configuring the maximum number of idle connections in the PostgreSQL connection pool.
Changes
MaxIDleConnsfield to theConfigstructSetMaxIdleConnson the database connection using the new parameterContext
This enhancement provides more flexibility in managing database connections, particularly useful for optimizing performance in huge ressources contexts