db.py 435 B

12345678910111213141516171819202122232425262728
  1. import config
  2. import database
  3. import typer
  4. app = typer.Typer()
  5. cfg = config.Config()
  6. @app.command()
  7. def create(config_file: str):
  8. config_file = cfg.system_dir + f"\\SQL\\config\\{config_file}.json"
  9. database.create(config_file)
  10. @app.command()
  11. def run():
  12. batch_dir = cfg.system_dir + "\\SQL\\batch"
  13. database.run(batch_dir)
  14. @app.command()
  15. def schema():
  16. database.schema()
  17. if __name__ == "__main__":
  18. app()