import db def main(): db.pool.open(wait=True, timeout=30) try: db.run_migrations() finally: db.pool.close() if __name__ == "__main__": main()