Added vacuum to CLI and Python API

This commit is contained in:
Simon Willison 2019-01-24 19:39:04 -08:00
commit 231224ba1a
6 changed files with 40 additions and 0 deletions

View file

@ -20,3 +20,14 @@ def table_names(path):
db = sqlite_utils.Database(path)
for name in db.table_names:
print(name)
@cli.command()
@click.argument(
"path",
type=click.Path(exists=True, file_okay=True, dir_okay=False, allow_dash=False),
required=True,
)
def vacuum(path):
"""Run VACUUM against the database"""
sqlite_utils.Database(path).vacuum()