optimize command now accepts optional tables, refs #155

This commit is contained in:
Simon Willison 2020-09-08 15:34:55 -07:00
commit 76548596a6
3 changed files with 13 additions and 5 deletions

View file

@ -703,7 +703,7 @@ You can run VACUUM to optimize your database like so::
Optimize
========
The optimize command can dramatically reduce the size of your database if you are using SQLite full-text search. It runs OPTIMIZE against all of our FTS4 and FTS5 tables, then runs VACUUM.
The optimize command can dramatically reduce the size of your database if you are using SQLite full-text search. It runs OPTIMIZE against all of your FTS4 and FTS5 tables, then runs VACUUM.
If you just want to run OPTIMIZE without the VACUUM, use the ``--no-vacuum`` flag.
@ -715,6 +715,11 @@ If you just want to run OPTIMIZE without the VACUUM, use the ``--no-vacuum`` fla
# Optimize but skip the VACUUM
$ sqlite-utils optimize --no-vacuum mydb.db
To optimize specific tables rather than every FTS table, pass those tables as extra arguments:
::
$ sqlite-utils optimize mydb.db table_1 table_2
.. _cli_wal:
WAL mode