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

support peewee connection pooling #236

Open
havok2063 opened this issue Feb 1, 2024 · 1 comment
Open

support peewee connection pooling #236

havok2063 opened this issue Feb 1, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@havok2063
Copy link
Collaborator

havok2063 commented Feb 1, 2024

Sqlalchemy has connection pooling built-in to its database connection that you can easily access/set up. Can we, or should we, implement a similar connection pooling for peewee? Peewee has this feature but as a separate class, https://docs.peewee-orm.com/en/latest/peewee/playhouse.html#pool. This might be as simple as switching out the PostgresqlDatabase class for the PooledPostgresqlDatabase class in our PeeweeDatabaseConnection, or perhaps creating another connection class altogether in sdssdb. I think ideally we'd want the former.

@albireox
Copy link
Member

albireox commented Feb 2, 2024

This sounds like a good idea. I gave it a very quick test in this PR but it seems it's a bit more complicated than changing PostgresqlDatabase to PooledPostgresqlExtDatabase, although maybe I missed something. See comments there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants