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

Expose more Sqlalchemy settings, part 1 #16742

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Conversation

cicdw
Copy link
Member

@cicdw cicdw commented Jan 15, 2025

This PR exposes additional SQLAlchemy configuration settings through Prefect settings to enable improved testing and optimization of database setups.

Note that this PR also introduces a change to our default SQLAlchemy configuration: specifically, it adds a new default of pool_recycle=3600 where we used to not use pool recycling at all.

If accepted, part 2 would be to expose settings that configure the connect_args specifically (which include application name, statement caching, etc.).

@@ -347,12 +351,6 @@ async def engine(self) -> AsyncEngine:
if self.timeout is not None:
kwargs["connect_args"] = dict(timeout=self.timeout)

if self.sqlalchemy_pool_size is not None:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added these in #16690 so this won't affect any released behavior.

Copy link

codspeed-hq bot commented Jan 15, 2025

CodSpeed Performance Report

Merging #16742 will not alter performance

Comparing sqlalchemy-settings (1b8792f) with main (e18e438)

Summary

✅ 2 untouched benchmarks

Copy link
Collaborator

@zzstoatzz zzstoatzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs enhancement An improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants