| 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 | |