mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-17 14:04:11 +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,
|
||||
help="Rename this column in extracted table",
|
||||
)
|
||||
@click.option(
|
||||
"-s",
|
||||
"--silent",
|
||||
is_flag=True,
|
||||
help="Don't show progress bar",
|
||||
)
|
||||
def extract(
|
||||
path,
|
||||
table,
|
||||
|
|
@ -1019,7 +1013,6 @@ def extract(
|
|||
other_table,
|
||||
fk_column,
|
||||
rename,
|
||||
silent,
|
||||
):
|
||||
"Extract one or more columns into a separate table"
|
||||
db = sqlite_utils.Database(path)
|
||||
|
|
@ -1029,14 +1022,7 @@ def extract(
|
|||
fk_column=fk_column,
|
||||
rename=dict(rename),
|
||||
)
|
||||
if silent:
|
||||
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)
|
||||
db[table].extract(**kwargs)
|
||||
|
||||
|
||||
@cli.command(name="insert-files")
|
||||
|
|
|
|||
|
|
@ -872,7 +872,7 @@ class Table(Queryable):
|
|||
)
|
||||
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 {}
|
||||
if isinstance(columns, str):
|
||||
columns = [columns]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue