MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / async_main

Function async_main

test/typing/plain_files/orm/sessionmakers.py:40–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38
39
40async def async_main() -> None:
41 fac = async_session_factory(async_engine)
42
43 async with fac() as sess:
44 assert_type(sess, MyAsyncSession)
45
46 async with fac.begin() as sess:
47 assert_type(sess, MyAsyncSession)
48
49 scoped_fac = async_scoped_session_factory(async_engine)
50
51 sess = scoped_fac()
52
53 assert_type(sess, MyAsyncSession)
54
55
56engine = create_engine("...")

Callers

nothing calls this directly

Calls 3

async_session_factoryFunction · 0.85
beginMethod · 0.45

Tested by

no test coverage detected