Return a new :class:`_engine.Connection` object. The :class:`_engine.Connection` acts as a Python context manager, so the typical use of this method looks like:: with engine.connect() as connection: connection.execute(text("insert into table values ('foo
(self)
| 3270 | conn._run_ddl_visitor(visitorcallable, element, **kwargs) |
| 3271 | |
| 3272 | def connect(self) -> Connection: |
| 3273 | """Return a new :class:`_engine.Connection` object. |
| 3274 | |
| 3275 | The :class:`_engine.Connection` acts as a Python context manager, so |
| 3276 | the typical use of this method looks like:: |
| 3277 | |
| 3278 | with engine.connect() as connection: |
| 3279 | connection.execute(text("insert into table values ('foo')")) |
| 3280 | connection.commit() |
| 3281 | |
| 3282 | Where above, after the block is completed, the connection is "closed" |
| 3283 | and its underlying DBAPI resources are returned to the connection pool. |
| 3284 | This also has the effect of rolling back any transaction that |
| 3285 | was explicitly begun or was begun via autobegin, and will |
| 3286 | emit the :meth:`_events.ConnectionEvents.rollback` event if one was |
| 3287 | started and is still in progress. |
| 3288 | |
| 3289 | .. seealso:: |
| 3290 | |
| 3291 | :meth:`_engine.Engine.begin` |
| 3292 | |
| 3293 | """ |
| 3294 | |
| 3295 | return self._connection_cls(self) |
| 3296 | |
| 3297 | def raw_connection(self) -> PoolProxiedConnection: |
| 3298 | """Return a "raw" DBAPI connection from the connection pool. |
no outgoing calls