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

Upgrade to psycopg3 from version 2 #201

Merged
merged 1 commit into from
Sep 22, 2023
Merged

Upgrade to psycopg3 from version 2 #201

merged 1 commit into from
Sep 22, 2023

Conversation

chouinar
Copy link
Contributor

Ticket

#200

Changes

Upgraded psycopg, the library that connects to Postgres for SQLAlchemy, to version 3.

Context for reviewers

Version 2 was named psycopg2 but version 3 is just psycopg so that they can upgrade without changing the package name moving forward.

Changing the connection string to postgresql+psycopg tells SQLAlchemy internally to use the new library: https://docs.sqlalchemy.org/en/20/dialects/postgresql.html#dialect-postgresql-psycopg-connect

Since we only have a few direct interactions with psycopg, the changes were fairly minimal, just adjusting the DB connection info object slightly.

Testing

Migrations, unit tests, and other automations still running fine.

Was able to pull up swagger and read/write to the DB via our endpoints.

@chouinar chouinar requested a review from lorenyu September 21, 2023 15:48
Copy link
Contributor

@lorenyu lorenyu left a comment

Choose a reason for hiding this comment

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

Nice

@chouinar chouinar merged commit 86b19bd into main Sep 22, 2023
4 checks passed
@chouinar chouinar deleted the chouinar/psycopg3 branch September 22, 2023 14:30
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.

2 participants