-
Notifications
You must be signed in to change notification settings - Fork 34
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
[FR] connection pooling #50
Comments
No plans so far. Feel free to contribute. |
Just saw this issue. Could it make sense to use the package in norm? |
It would be awesome to support it in Norm. I see the package is compatible with Nim stdlib's DbConn type, so it shouldn't be too hard to use. |
In that case my first approach would likely be copy pasting the code into norm, modifying it to better integrate with norm's logging and swapping out the std/db_* libs with ndb/sqlite and ndb/postgres. |
The general code and logic is implemented in genericPool. It provides instructions how to handle a pool of connections. The pool itself is just a glorified seq of pre-determined size with a lock for safe multithreaded access. It fills with connections upon initialization and closes them upon destruction. Should connections run out during runtime, it goes into "burst-mode" for a limited time. Burst mode refills the pool and allows it to have essentially infinite size. Only after its timer runs out does it go back to "normal" mode, after which every connection that would make the pool larger than its intended size gets closed. The timer gets extended every time it is noticed that more connections are still needed.
The proc is about database manipulation, not connection pooling and thus does not belong in the module.
nice one moigagoo |
I saw that there is this project that has conn pooling
https://nimble.directory/pkg/pg
also that JohnAD has plans to pull mongodb and conn pooling.
Have we got plans for conn pooling for postgress/sqlite?
The text was updated successfully, but these errors were encountered: