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 --- lib/sqlalchemy/engine/interfaces.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'lib/sqlalchemy/engine/interfaces.py') diff --git a/lib/sqlalchemy/engine/interfaces.py b/lib/sqlalchemy/engine/interfaces.py index 251d01c5e..faaf073ab 100644 --- a/lib/sqlalchemy/engine/interfaces.py +++ b/lib/sqlalchemy/engine/interfaces.py @@ -1113,6 +1113,25 @@ class Dialect: """ return cls + @classmethod + def get_async_dialect_cls(cls, url): + """Given a URL, return the :class:`.Dialect` that will be used by + an async engine. + + By default this is an alias of :meth:`.Dialect.get_dialect_cls` and + just returns the cls. It may be used if a dialect provides + both a sync and async version under the same name, like the + ``psycopg`` driver. + + .. versionadded:: 2 + + .. seealso:: + + :meth:`.Dialect.get_dialect_cls` + + """ + return cls.get_dialect_cls(url) + @classmethod def load_provisioning(cls): """set up the provision.py module for this dialect. -- cgit v1.2.1