1234567891011121314151617181920212223242526272829303132333435 |
- import config
- import database
- import typer
- 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 run(max: int = 5):
- batch_dir = cfg.system_dir + "\\SQL\\batch"
- database.run(batch_dir, 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()
|