forked from Hay1tsme/artemis
fix: make database async
This commit is contained in:
11
dbutils.py
11
dbutils.py
@ -1,12 +1,13 @@
|
||||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
import logging
|
||||
from os import mkdir, path, access, W_OK, environ
|
||||
import yaml
|
||||
import asyncio
|
||||
import logging
|
||||
from os import W_OK, access, environ, mkdir, path
|
||||
|
||||
import yaml
|
||||
|
||||
from core.data import Data
|
||||
from core.config import CoreConfig
|
||||
from core.data import Data
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description="Database utilities")
|
||||
@ -46,7 +47,7 @@ if __name__ == "__main__":
|
||||
loop = asyncio.get_event_loop()
|
||||
|
||||
if args.action == "create":
|
||||
data.create_database()
|
||||
loop.run_until_complete(data.create_database())
|
||||
|
||||
elif args.action == "upgrade":
|
||||
data.schema_upgrade(args.version)
|
||||
|
Reference in New Issue
Block a user