mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-25 18:34:32 +02:00
-c / --column option
This commit is contained in:
parent
61461b9881
commit
ef219d6b4d
1 changed files with 4 additions and 1 deletions
|
|
@ -1361,11 +1361,13 @@ def insert_files(
|
|||
required=True,
|
||||
)
|
||||
@click.argument("tables", nargs=-1)
|
||||
@click.option("-c", "--column", "columns", type=str, multiple=True, help="Specific columns to analyze")
|
||||
@click.option("--save", is_flag=True, help="Save results to _analyze_tables table")
|
||||
@load_extension_option
|
||||
def analyze_tables(
|
||||
path,
|
||||
tables,
|
||||
columns,
|
||||
save,
|
||||
load_extension,
|
||||
):
|
||||
|
|
@ -1379,7 +1381,8 @@ def analyze_tables(
|
|||
for table in tables:
|
||||
table_counts[table] = db[table].count
|
||||
for column in db[table].columns:
|
||||
todo.append((table, column.name))
|
||||
if (not columns or column.name in columns):
|
||||
todo.append((table, column.name))
|
||||
# Now we now how many we need to do
|
||||
for i, (table, column) in enumerate(todo):
|
||||
column_details = db[table].analyze_column(column, total_rows=table_counts[table])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue