MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / go

Function go

test/typing/plain_files/ext/asyncio/async_stuff.py:17–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15
16
17async def go() -> None:
18 r = await async_session.scalars(text("select 1"), params=[])
19 r.first()
20 sr = await async_session.stream_scalars(text("select 1"), params=[])
21 await sr.all()
22 r = await as_session.scalars(text("select 1"), params=[])
23 r.first()
24 sr = await as_session.stream_scalars(text("select 1"), params=[])
25 await sr.all()
26
27 async with engine.connect() as conn:
28 cr = await conn.scalars(text("select 1"))
29 cr.first()
30 scr = await conn.stream_scalars(text("select 1"))
31 await scr.all()
32
33 ast = async_session.get_transaction()
34 if ast:
35 ast.is_active
36 nt = async_session.get_nested_transaction()
37 if nt:
38 nt.is_active

Callers

nothing calls this directly

Calls 8

textFunction · 0.90
scalarsMethod · 0.45
firstMethod · 0.45
stream_scalarsMethod · 0.45
allMethod · 0.45
connectMethod · 0.45
get_transactionMethod · 0.45

Tested by

no test coverage detected