mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 09:24:31 +02:00
sqlite-utils dump command, closes #274
This commit is contained in:
parent
fe1562e8a6
commit
ca2b26130f
3 changed files with 35 additions and 0 deletions
|
|
@ -308,6 +308,21 @@ def vacuum(path):
|
|||
sqlite_utils.Database(path).vacuum()
|
||||
|
||||
|
||||
@cli.command()
|
||||
@click.argument(
|
||||
"path",
|
||||
type=click.Path(exists=True, file_okay=True, dir_okay=False, allow_dash=False),
|
||||
required=True,
|
||||
)
|
||||
@load_extension_option
|
||||
def dump(path, load_extension):
|
||||
"""Output a SQL dump of the schema and full contents of the database"""
|
||||
db = sqlite_utils.Database(path)
|
||||
_load_extensions(db, load_extension)
|
||||
for line in db.conn.iterdump():
|
||||
click.echo(line)
|
||||
|
||||
|
||||
@cli.command(name="add-column")
|
||||
@click.argument(
|
||||
"path",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue