MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / start

Method start

lib/sqlalchemy/ext/asyncio/engine.py:1420–1435  ·  view source on GitHub ↗

Start this :class:`_asyncio.AsyncTransaction` object's context outside of using a Python ``with:`` block.

(self, is_ctxmanager: bool = False)

Source from the content-addressed store, hash-verified

1418 await greenlet_spawn(self._proxied.commit)
1419
1420 async def start(self, is_ctxmanager: bool = False) -> AsyncTransaction:
1421 """Start this :class:`_asyncio.AsyncTransaction` object's context
1422 outside of using a Python ``with:`` block.
1423
1424 """
1425
1426 self.sync_transaction = self._assign_proxied(
1427 await greenlet_spawn(
1428 self.connection._proxied.begin_nested
1429 if self.nested
1430 else self.connection._proxied.begin
1431 )
1432 )
1433 if is_ctxmanager:
1434 self.sync_transaction.__enter__()
1435 return self
1436
1437 async def __aexit__(self, type_: Any, value: Any, traceback: Any) -> None:
1438 await greenlet_spawn(self._proxied.__exit__, type_, value, traceback)

Callers

nothing calls this directly

Calls 3

greenlet_spawnFunction · 0.85
_assign_proxiedMethod · 0.80
__enter__Method · 0.45

Tested by

no test coverage detected