1234567891011121314151617181920212223242526272829303132333435363738394041 |
- import typer
- import config
- import database
- app = typer.Typer()
- cfg = config.Config()
- @app.command()
- def create(config_file: str):
- config_file = cfg.system_dir + f"\\SQL\\config\\{config_file}.json"
- database.create(config_file)
- @app.command()
- def compare(config_file: str):
- config_file = cfg.system_dir + f"\\SQL\\config\\{config_file}.json"
- database.compare(config_file)
- @app.command()
- def run(config_file: str, increment: str = "1", max: int = 5):
- config_file = cfg.system_dir + f"\\SQL\\config\\{config_file}.json"
- database.run(config_file, increment == "1", max)
- @app.command()
- def schema():
- database.schema()
- @app.command()
- def bcp_log():
- logs_dir = cfg.system_dir + "\\SQL\\temp"
- output_file = cfg.log_dir + "\\bcp.csv.log"
- database.bcp_log(logs_dir, output_file)
- if __name__ == "__main__":
- app()
|