MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _ConnDialect

Class _ConnDialect

lib/sqlalchemy/pool/base.py:109–141  ·  view source on GitHub ↗

partial implementation of :class:`.Dialect` which provides DBAPI connection methods. When a :class:`_pool.Pool` is combined with an :class:`_engine.Engine`, the :class:`_engine.Engine` replaces this with its own :class:`.Dialect`.

Source from the content-addressed store, hash-verified

107
108
109class _ConnDialect:
110 """partial implementation of :class:`.Dialect`
111 which provides DBAPI connection methods.
112
113 When a :class:`_pool.Pool` is combined with an :class:`_engine.Engine`,
114 the :class:`_engine.Engine` replaces this with its own
115 :class:`.Dialect`.
116
117 """
118
119 is_async = False
120 has_terminate = False
121
122 def do_rollback(self, dbapi_connection: PoolProxiedConnection) -> None:
123 dbapi_connection.rollback()
124
125 def do_commit(self, dbapi_connection: PoolProxiedConnection) -> None:
126 dbapi_connection.commit()
127
128 def do_terminate(self, dbapi_connection: DBAPIConnection) -> None:
129 dbapi_connection.close()
130
131 def do_close(self, dbapi_connection: DBAPIConnection) -> None:
132 dbapi_connection.close()
133
134 def _do_ping_w_event(self, dbapi_connection: DBAPIConnection) -> bool:
135 raise NotImplementedError(
136 "The ping feature requires that a dialect is "
137 "passed to the connection pool."
138 )
139
140 def get_driver_connection(self, connection: DBAPIConnection) -> Any:
141 return connection
142
143
144class _AsyncConnDialect(_ConnDialect):

Callers 2

PoolClass · 0.85

Calls

no outgoing calls

Tested by 1