diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2022-02-17 21:40:58 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@ci3.zzzcomputing.com> | 2022-02-17 21:40:58 +0000 |
| commit | cb35da20d7b93618814a9582a122cc1b24f806b2 (patch) | |
| tree | 4e7618a0beb6273dc8363888f34c79bcd361db34 /lib/sqlalchemy/engine/interfaces.py | |
| parent | c5756b11a0eceb6ba4c868b52daf676652940835 (diff) | |
| parent | 5157e0aa542f390242dd7a6d27a6ce1663230e46 (diff) | |
| download | sqlalchemy-cb35da20d7b93618814a9582a122cc1b24f806b2.tar.gz | |
Merge "pep-484 for pool" into main
Diffstat (limited to 'lib/sqlalchemy/engine/interfaces.py')
| -rw-r--r-- | lib/sqlalchemy/engine/interfaces.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/sqlalchemy/engine/interfaces.py b/lib/sqlalchemy/engine/interfaces.py index ce884614c..aab6b2de8 100644 --- a/lib/sqlalchemy/engine/interfaces.py +++ b/lib/sqlalchemy/engine/interfaces.py @@ -59,7 +59,7 @@ class DBAPIConnection(Protocol): def commit(self) -> None: ... - def cursor(self) -> "DBAPICursor": + def cursor(self) -> DBAPICursor: ... def rollback(self) -> None: @@ -657,6 +657,9 @@ class Dialect: """ + is_async: bool + """Whether or not this dialect is intended for asyncio use.""" + def create_connect_args( self, url: "URL" ) -> Tuple[Tuple[str], Mapping[str, Any]]: @@ -1091,7 +1094,7 @@ class Dialect: raise NotImplementedError() - def do_close(self, dbapi_connection: PoolProxiedConnection) -> None: + def do_close(self, dbapi_connection: DBAPIConnection) -> None: """Provide an implementation of ``connection.close()``, given a DBAPI connection. @@ -1104,6 +1107,11 @@ class Dialect: raise NotImplementedError() + def do_ping(self, dbapi_connection: DBAPIConnection) -> bool: + """ping the DBAPI connection and return True if the connection is + usable.""" + raise NotImplementedError() + def do_set_input_sizes( self, cursor: DBAPICursor, @@ -1679,7 +1687,7 @@ class Dialect: """ - def get_driver_connection(self, connection: PoolProxiedConnection) -> Any: + def get_driver_connection(self, connection: DBAPIConnection) -> Any: """Returns the connection object as returned by the external driver package. |
