MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / async_setup

Method async_setup

test/dialect/postgresql/test_async_pg.py:31–47  ·  view source on GitHub ↗
(engine, strlen)

Source from the content-addressed store, hash-verified

29 self, metadata, async_testing_engine
30 ):
31 async def async_setup(engine, strlen):
32 metadata.clear()
33 t1 = Table(
34 "t1",
35 metadata,
36 Column("id", Integer, primary_key=True),
37 Column("name", String(strlen)),
38 )
39
40 # conn is an instance of AsyncConnection
41 async with engine.begin() as conn:
42 await conn.run_sync(metadata.drop_all)
43 await conn.run_sync(metadata.create_all)
44 await conn.execute(
45 t1.insert(),
46 [{"name": "some name %d" % i} for i in range(500)],
47 )
48
49 meta = MetaData()
50

Callers

nothing calls this directly

Calls 10

TableClass · 0.90
ColumnClass · 0.90
StringClass · 0.90
MetaDataClass · 0.90
ENUMClass · 0.90
clearMethod · 0.45
beginMethod · 0.45
run_syncMethod · 0.45
executeMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected