MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / setup

Function setup

examples/sharding/asyncio.py:257–265  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

255
256
257async def setup():
258 # create tables
259 for db in (db1, db2, db3, db4):
260 async with db.begin() as conn:
261 await conn.run_sync(Base.metadata.create_all)
262
263 # establish initial "id" in db1
264 async with db1.begin() as conn:
265 await conn.execute(ids.insert(), {"nextid": 1})
266
267
268async def main():

Callers 2

mainFunction · 0.70
setup.pyFile · 0.50

Calls 4

beginMethod · 0.45
run_syncMethod · 0.45
executeMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected