示例#1
0
def __do_clear_data(loop):
    yield from orm.create_pool(loop=loop, **configs.db)
    sql = 'DELETE FROM weibos;' \
          'DELETE FROM weibo_users;'
    logging.info(sql)
    if(yield from orm.just_excute_sql(sql)):
        logging.info("success")
示例#2
0
def excute_sql(sql):
    loop = asyncio.get_event_loop()
    yield from orm.create_pool(loop=loop, **configs.db)
    yield from orm.just_excute_sql(sql)