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

feat: Consolidate non-cloud postgres provider #495

Merged
merged 8 commits into from
Sep 21, 2024

Conversation

anubhav756
Copy link
Contributor

To align with our existing AlloyDB and CloudSQL providers, we're updating the non-cloud Postgres provider to use SQLAlchemy. This consolidates all Postgres interactions through the common postgres_datastore.py reusing its query handlers.

@anubhav756 anubhav756 changed the base branch from tracing to main September 18, 2024 21:58
To align with our existing AlloyDB and CloudSQL providers, we're updating the non-cloud Postgres provider to use SQLAlchemy. This consolidates all Postgres interactions through the common `postgres_datastore.py` reusing its query handlers.
@anubhav756 anubhav756 changed the base branch from main to tracing September 18, 2024 22:07
@anubhav756 anubhav756 marked this pull request as ready for review September 18, 2024 22:07
@anubhav756 anubhav756 requested a review from a team as a code owner September 18, 2024 22:07
Copy link
Member

@vishwarajanand vishwarajanand left a comment

Choose a reason for hiding this comment

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

Approving to unblock.. changes LGTM with minor suggestions on variabe names.

To align with our existing AlloyDB and CloudSQL providers, we're updating the non-cloud Postgres provider to use SQLAlchemy. This consolidates all Postgres interactions through the common `postgres_datastore.py` reusing its query handlers.
This commit renames the `pool` variable to `async_engine` in all Postgres providers.

Previously, these providers used `asyncpg` directly for connection pool management.  They have now been migrated to SQLAlchemy, which uses `AsyncEngine` for connection management. This name change reflects the shift to SQLAlchemy and provides better clarity.
This is now possible since non-cloud `postgres.py` was the only file where tuple was being passed to `format_sql` prior to its consolidation, but after consolidation, it passes `dict` only.
@anubhav756 anubhav756 changed the base branch from tracing to main September 20, 2024 21:24
@anubhav756 anubhav756 force-pushed the sqlalchemy-non-cloud branch 2 times, most recently from 6c59fef to 2907d4a Compare September 20, 2024 22:22
@anubhav756 anubhav756 changed the base branch from main to tracing September 21, 2024 08:16
@anubhav756 anubhav756 merged commit 0a4dd64 into tracing Sep 21, 2024
15 checks passed
@anubhav756 anubhav756 deleted the sqlalchemy-non-cloud branch September 21, 2024 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants