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

Add support for postgresql+psycopg as allowed scheme to use with PostgreDsn #4689

Closed
3 of 13 tasks
morian opened this issue Oct 29, 2022 · 2 comments
Closed
3 of 13 tasks

Comments

@morian
Copy link
Contributor

morian commented Oct 29, 2022

Initial Checks

  • I have searched Google & GitHub for similar requests and couldn't find anything
  • I have read and followed the docs and still think this feature is missing

Description

SQLAlchemy 2.0 (currently in beta) now supports psycopg (a.k.a. psycopg3).

This was introduced as a new dialect by the following commit:
sqlalchemy/sqlalchemy@5eb407f

The connection string appears to be postgresql+psycopg://user:password@host:port/dbname[?key=value&key=value...] but unfortunately it is not recognized by pydantic as a valid scheme by PostgresDsn from networks.py.

Would it be possible to add it as an allowed scheme for PostgresDsn?

By looking at the code and while not familiar with cockroachdb, it seems like it would also benefit from this support:
https://www.cockroachlabs.com/docs/stable/build-a-python-app-with-cockroachdb-psycopg3.html

Thanks!

Affected Components

@samuelcolvin
Copy link
Member

PR welcome to add postgresql+psycopg on main and we can cherry-pick it to v1. 10.

@samuelcolvin
Copy link
Member

closed via #4690.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants