wip
This commit is contained in:
parent
4be274d9e2
commit
c238b9d757
21 changed files with 219 additions and 184 deletions
50
learn_sql_model/cli/model.py
Normal file
50
learn_sql_model/cli/model.py
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
import typer
|
||||
|
||||
from learn_sql_model.cli.common import verbose_callback
|
||||
|
||||
model_app = typer.Typer()
|
||||
|
||||
|
||||
@model_app.callback()
|
||||
def model(
|
||||
verbose: bool = typer.Option(
|
||||
False,
|
||||
callback=verbose_callback,
|
||||
help="show the log messages",
|
||||
),
|
||||
):
|
||||
"model cli"
|
||||
|
||||
|
||||
@model_app.command()
|
||||
def create_revision(
|
||||
verbose: bool = typer.Option(
|
||||
False,
|
||||
callback=verbose_callback,
|
||||
help="show the log messages",
|
||||
),
|
||||
message: str = typer.Option(
|
||||
prompt=True,
|
||||
),
|
||||
):
|
||||
import alembic
|
||||
# python -m alembic revision --autogenerate -m "New Attribute"
|
||||
from alembic.config import Config
|
||||
|
||||
alembic_cfg = Config("alembic.ini")
|
||||
alembic.command.revision(
|
||||
config=alembic_cfg,
|
||||
message=message,
|
||||
autogenerate=True,
|
||||
)
|
||||
|
||||
|
||||
@model_app.command()
|
||||
def populate(
|
||||
verbose: bool = typer.Option(
|
||||
False,
|
||||
callback=verbose_callback,
|
||||
help="show the log messages",
|
||||
),
|
||||
):
|
||||
...
|
||||
Loading…
Add table
Add a link
Reference in a new issue