Commit 3ec363a6 authored by Aurélien Campéas's avatar Aurélien Campéas
Browse files

cli: provide an override for the shell command

parent bf0fdfff7fdd
......@@ -13,7 +13,8 @@ setup(name='tshistory_supervision',
'tshistory'
],
entry_points={'tshistory.subcommands': [
'migrate-supervision=tshistory_supervision.cli:migrate_supervision'
'migrate-supervision=tshistory_supervision.cli:migrate_supervision',
'shell=tshistory_supervision.cli:shell'
]},
classifiers=[
'Development Status :: 4 - Beta',
......
......@@ -3,6 +3,8 @@ import click
from sqlalchemy import create_engine
from tshistory.util import find_dburi
from tshistory_supervision.tsio import timeseries
@click.command(name='migrate-supervision')
@click.argument('dburi')
......@@ -23,3 +25,13 @@ def migrate_supervision(dburi, skip_schema=False, namespace='tsh'):
f'alter schema "{namespace}-automatic.snapshot" '
f'rename to "{namespace}-upstream.snapshot"'
)
@click.command(name='shell')
@click.argument('db-uri')
@click.option('--namespace', default='tsh')
def shell(db_uri, namespace='tsh'):
e = create_engine(find_dburi(db_uri))
tsh = timeseries(namespace)
import pdb; pdb.set_trace()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment