Skip to content

Commit

Permalink
Add postgresql+psycopg as allowed scheme for PostgreDsn (#4689) (#4690)
Browse files Browse the repository at this point in the history
  • Loading branch information
morian committed Oct 31, 2022
1 parent f7ff485 commit 5dd9b4f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions changes/4689-morian.md
@@ -0,0 +1 @@
Add `postgresql+psycopg` as allowed scheme for `PostgreDsn` to make it usable with SQLAlchemy 2
1 change: 1 addition & 0 deletions docs/usage/types.md
Expand Up @@ -598,6 +598,7 @@ For URI/URL validation the following types are available:
- `postgresql`
- `postgresql+asyncpg`
- `postgresql+pg8000`
- `postgresql+psycopg`
- `postgresql+psycopg2`
- `postgresql+psycopg2cffi`
- `postgresql+py-postgresql`
Expand Down
1 change: 1 addition & 0 deletions pydantic/networks.py
Expand Up @@ -490,6 +490,7 @@ class PostgresDsn(MultiHostDsn):
'postgresql',
'postgresql+asyncpg',
'postgresql+pg8000',
'postgresql+psycopg',
'postgresql+psycopg2',
'postgresql+psycopg2cffi',
'postgresql+py-postgresql',
Expand Down
1 change: 1 addition & 0 deletions tests/test_networks.py
Expand Up @@ -37,6 +37,7 @@
'postgres://just-user@localhost:5432/app',
'postgresql+asyncpg://user:pass@localhost:5432/app',
'postgresql+pg8000://user:pass@localhost:5432/app',
'postgresql+psycopg://postgres:postgres@localhost:5432/hatch',
'postgresql+psycopg2://postgres:postgres@localhost:5432/hatch',
'postgresql+psycopg2cffi://user:pass@localhost:5432/app',
'postgresql+py-postgresql://user:pass@localhost:5432/app',
Expand Down

0 comments on commit 5dd9b4f

Please sign in to comment.