generate_data.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:aiohttp_admin 作者: aio-libs 项目源码 文件源码
def preapre_tables(pg):
    tables = [db.question, db.choice]
    async with pg.acquire() as conn:
        for table in reversed(tables):
            drop_expr = DropTable(table)
            try:
                await conn.execute(drop_expr)
            except psycopg2.ProgrammingError:
                pass

    async with pg.acquire() as conn:
        for table in tables:
            create_expr = CreateTable(table)
            await conn.execute(create_expr)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号