Docs for --no-most --no-least --common-limit, refs #544

This commit is contained in:
Simon Willison 2023-05-21 08:53:10 -07:00
commit 9e9d63b989
2 changed files with 14 additions and 7 deletions

View file

@ -564,10 +564,13 @@ See :ref:`cli_analyze_tables`.
sqlite-utils analyze-tables data.db trees
Options:
-c, --column TEXT Specific columns to analyze
--save Save results to _analyze_tables table
--load-extension TEXT Path to SQLite extension, with optional :entrypoint
-h, --help Show this message and exit.
-c, --column TEXT Specific columns to analyze
--save Save results to _analyze_tables table
--common-limit INTEGER How many common values
--no-most Skip most common values
--no-least Skip least common values
--load-extension TEXT Path to SQLite extension, with optional :entrypoint
-h, --help Show this message and exit.
.. _cli_ref_convert:

View file

@ -730,11 +730,15 @@ For each column this tool displays the number of null rows, the number of blank
If you do not specify any tables every table in the database will be analyzed::
$ sqlite-utils analyze-tables github.db
sqlite-utils analyze-tables github.db
If you wish to analyze one or more specific columns, use the ``-c`` option::
$ sqlite-utils analyze-tables github.db tags -c sha
sqlite-utils analyze-tables github.db tags -c sha
To show more than 10 common values, use ``--common-limit 20``. To skip the most common or least common value analysis, use ``--no-most`` or ``--no-least``::
sqlite-utils analyze-tables github.db tags --common-limit 20 --no-least
.. _cli_analyze_tables_save:
@ -743,7 +747,7 @@ Saving the analyzed table details
``analyze-tables`` can take quite a while to run for large database files. You can save the results of the analysis to a database table called ``_analyze_tables_`` using the ``--save`` option::
$ sqlite-utils analyze-tables github.db --save
sqlite-utils analyze-tables github.db --save
The ``_analyze_tables_`` table has the following schema::