Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a ConnectionPool #256

Open
fabianfett opened this issue Mar 11, 2022 · 9 comments
Open

Provide a ConnectionPool #256

fabianfett opened this issue Mar 11, 2022 · 9 comments
Assignees
Labels
ConnectionPool Features and bugs that are related to the impl in ConnectionPoolModule enhancement New feature or request

Comments

@fabianfett
Copy link
Collaborator

We should provide a ConnectionPool out of the box.

@fabianfett fabianfett added the enhancement New feature or request label Mar 11, 2022
@Jerry-Carter
Copy link
Contributor

Absolutely agreed.

@Jerry-Carter
Copy link
Contributor

Jerry-Carter commented Mar 17, 2022

I have a very simple connection pool implementation which is an actor with dependencies on NIO, PostgresNIO, and Logging. Having the application pass in the PostgresConnection.Configuration would further simplify it. Typical usage is to initialize the actor, and then Checkout() and Release() database connections as required in the application.

Happy to donate it, but I would expect that better code exists elsewhere in the Vapor code base.

@CyrilusK
Copy link

Снимок экрана 2022-05-15 в 19 02 22

Can you help with this?

@trasch
Copy link
Contributor

trasch commented Apr 28, 2023

I can also offer a connection pool for those interested: https://github.com/Outdooractive/PostgresConnectionPool

@fabianfett fabianfett added this to the 2.0.0 milestone Aug 10, 2023
@majortom64
Copy link

For security purposes it would be great to support ephemeral database user credentials, generated by something like HashiCorp’s Vault. These credentials timeout and then need to be regenerated. When they change, the Connection Pool would need to automatically close or automatically handle getting the new credentials and updating the connection.

@fabianfett
Copy link
Collaborator Author

Work can be followed in the ConnectionPool milestone.

@fabianfett fabianfett self-assigned this Oct 13, 2023
@fabianfett
Copy link
Collaborator Author

@majortom64 your request is tracked as #431.

@fabianfett fabianfett added the ConnectionPool Features and bugs that are related to the impl in ConnectionPoolModule label Oct 28, 2023
@fabianfett
Copy link
Collaborator Author

We've released a PostgresClient implementation behind an SPI flag in the 1.19.0 release:
https://github.com/vapor/postgres-nio/releases/tag/1.19.0

We would love to learn, if this solves your use-cases.

@lovetodream
Copy link
Contributor

I just implemented the _ConnectionPoolModule in the Oracle driver I'm working on. The API is very easy to understand imo. It actually surprised me how little I had to do to get everything working. Thanks for the great work @fabianfett!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ConnectionPool Features and bugs that are related to the impl in ConnectionPoolModule enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants