mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-27 20:34:12 +02:00
Removed unnecessary progress bar, refs #172
This commit is contained in:
parent
61015c8f64
commit
bf15acde88
2 changed files with 2 additions and 16 deletions
|
|
@ -1006,12 +1006,6 @@ def transform(
|
||||||
multiple=True,
|
multiple=True,
|
||||||
help="Rename this column in extracted table",
|
help="Rename this column in extracted table",
|
||||||
)
|
)
|
||||||
@click.option(
|
|
||||||
"-s",
|
|
||||||
"--silent",
|
|
||||||
is_flag=True,
|
|
||||||
help="Don't show progress bar",
|
|
||||||
)
|
|
||||||
def extract(
|
def extract(
|
||||||
path,
|
path,
|
||||||
table,
|
table,
|
||||||
|
|
@ -1019,7 +1013,6 @@ def extract(
|
||||||
other_table,
|
other_table,
|
||||||
fk_column,
|
fk_column,
|
||||||
rename,
|
rename,
|
||||||
silent,
|
|
||||||
):
|
):
|
||||||
"Extract one or more columns into a separate table"
|
"Extract one or more columns into a separate table"
|
||||||
db = sqlite_utils.Database(path)
|
db = sqlite_utils.Database(path)
|
||||||
|
|
@ -1029,14 +1022,7 @@ def extract(
|
||||||
fk_column=fk_column,
|
fk_column=fk_column,
|
||||||
rename=dict(rename),
|
rename=dict(rename),
|
||||||
)
|
)
|
||||||
if silent:
|
db[table].extract(**kwargs)
|
||||||
db[table].extract(**kwargs)
|
|
||||||
else:
|
|
||||||
with click.progressbar(
|
|
||||||
length=db[table].count, label="Extracting columns"
|
|
||||||
) as bar:
|
|
||||||
kwargs["progress"] = bar.update
|
|
||||||
db[table].extract(**kwargs)
|
|
||||||
|
|
||||||
|
|
||||||
@cli.command(name="insert-files")
|
@cli.command(name="insert-files")
|
||||||
|
|
|
||||||
|
|
@ -872,7 +872,7 @@ class Table(Queryable):
|
||||||
)
|
)
|
||||||
return sqls
|
return sqls
|
||||||
|
|
||||||
def extract(self, columns, table=None, fk_column=None, rename=None, progress=None):
|
def extract(self, columns, table=None, fk_column=None, rename=None):
|
||||||
rename = rename or {}
|
rename = rename or {}
|
||||||
if isinstance(columns, str):
|
if isinstance(columns, str):
|
||||||
columns = [columns]
|
columns = [columns]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue