From 5eb407f84bdabdbcd68975dbf76dc4c0809d7373 Mon Sep 17 00:00:00 2001 From: Federico Caselli Date: Tue, 14 Sep 2021 23:38:00 +0200 Subject: Added support for ``psycopg`` dialect. Both sync and async versions are supported. Fixes: #6842 Change-Id: I57751c5028acebfc6f9c43572562405453a2f2a4 --- doc/build/changelog/migration_20.rst | 25 +++++++++++++++++++++++++ doc/build/changelog/unreleased_14/6842.rst | 14 ++++++++++++++ doc/build/dialects/postgresql.rst | 7 +++++++ 3 files changed, 46 insertions(+) create mode 100644 doc/build/changelog/unreleased_14/6842.rst (limited to 'doc') diff --git a/doc/build/changelog/migration_20.rst b/doc/build/changelog/migration_20.rst index b75cefb31..1c0169888 100644 --- a/doc/build/changelog/migration_20.rst +++ b/doc/build/changelog/migration_20.rst @@ -77,6 +77,31 @@ New Features and Improvements This section covers new features and improvements in SQLAlchemy 2.0 which are not otherwise part of the major 1.4->2.0 migration path. +.. _ticket_6842: + +Dialect support for psycopg 3 (a.k.a. "psycopg") +------------------------------------------------- + +Added dialect support for the `psycopg 3 `_ +DBAPI, which despite the number "3" now goes by the package name ``psycopg``, +superseding the previous ``psycopg2`` package that for the time being remains +SQLAlchemy's "default" driver for the ``postgresql`` dialects. ``psycopg`` is a +completely reworked and modernized database adapter for PostgreSQL which +supports concepts such as prepared statements as well as Python asyncio. + +``psycopg`` is the first DBAPI supported by SQLAlchemy which provides +both a pep-249 synchronous API as well as an asyncio driver. The same +``psycopg`` database URL may be used with the :func:`_sa.create_engine` +and :func:`_asyncio.create_async_engine` engine-creation functions, and the +corresponding sync or asyncio version of the dialect will be selected +automatically. + +.. seealso:: + + :ref:`postgresql_psycopg` + + + Behavioral Changes ================== diff --git a/doc/build/changelog/unreleased_14/6842.rst b/doc/build/changelog/unreleased_14/6842.rst new file mode 100644 index 000000000..43b3841ce --- /dev/null +++ b/doc/build/changelog/unreleased_14/6842.rst @@ -0,0 +1,14 @@ +.. change:: + :tags: postgresql, dialect + :tickets: 6842 + + Added support for ``psycopg`` dialect supporting both sync and async + execution. This dialect is available under the ``postgresql+psycopg`` name + for both the :func:`_sa.create_engine` and + :func:`_asyncio.create_async_engine` engine-creation functions. + + .. seealso:: + + :ref:`ticket_6842` + + :ref:`postgresql_psycopg` \ No newline at end of file diff --git a/doc/build/dialects/postgresql.rst b/doc/build/dialects/postgresql.rst index 958f8e060..d3c9928c7 100644 --- a/doc/build/dialects/postgresql.rst +++ b/doc/build/dialects/postgresql.rst @@ -193,6 +193,13 @@ psycopg2 .. automodule:: sqlalchemy.dialects.postgresql.psycopg2 +.. _postgresql_psycopg: + +psycopg +-------- + +.. automodule:: sqlalchemy.dialects.postgresql.psycopg + pg8000 ------ -- cgit v1.2.1