Skip to content

Update psycopg to v3 to work with the defaults in sqlalchemy 2#454

Merged
cmccully merged 3 commits intomainfrom
psycopg3
Apr 7, 2026
Merged

Update psycopg to v3 to work with the defaults in sqlalchemy 2#454
cmccully merged 3 commits intomainfrom
psycopg3

Conversation

@cmccully
Copy link
Copy Markdown
Collaborator

@cmccully cmccully commented Apr 7, 2026

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the project’s PostgreSQL driver and SQLAlchemy requirements to align with SQLAlchemy 2 defaults, and bumps the package version accordingly.

Changes:

  • Bump lco-banzai version to 1.33.1 and add a changelog entry.
  • Replace psycopg2-binary with psycopg[binary] and update SQLAlchemy requirement to >=2.
  • Update SQLAlchemy ORM imports to the SQLAlchemy 2.x-supported locations.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
uv.lock Locks updated dependency set: psycopg v3 (+ psycopg-binary) and SQLAlchemy >=2.
pyproject.toml Runtime dependency updates for SQLAlchemy 2 and psycopg v3; version bump.
CHANGES.md Adds 1.33.1 release note documenting the driver update.
banzai/dbs.py Updates SQLAlchemy import paths for compatibility with SQLAlchemy 2.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyproject.toml
Comment thread pyproject.toml
"pytest>=4.0",
"pyyaml",
"psycopg2-binary",
"psycopg[binary]",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

After upgrading psycopg to v3 I think you will need to change any postgres connection urls to postgresql+psycopg:// to target the psycopg3 driver.. See https://docs.sqlalchemy.org/en/20/dialects/postgresql.html#module-sqlalchemy.dialects.postgresql.psycopg

Copy link
Copy Markdown
Contributor

@sfoale sfoale left a comment

Choose a reason for hiding this comment

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

Not sure this is going to work with the existing postgres connection urls, if I'm reading the documentation right,

Copy link
Copy Markdown
Contributor

@sfoale sfoale left a comment

Choose a reason for hiding this comment

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

Looks good now.

@cmccully cmccully merged commit fc8f7a7 into main Apr 7, 2026
10 of 11 checks passed
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