mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-26 02:44:33 +02:00
.reset_counts() method and reset-counts command, closes #219
This commit is contained in:
parent
b4f09146d3
commit
0d2a47eab9
4 changed files with 56 additions and 2 deletions
|
|
@ -1074,6 +1074,10 @@ The ``sqlite-utils enable-counts`` command can be used to configure these trigge
|
|||
# Configure triggers just for specific tables
|
||||
$ sqlite-utils enable-counts mydb.db table1 table2
|
||||
|
||||
If the ``_counts`` table ever becomes out-of-sync with the actual table counts you can repair it using the ``reset-counts`` command::
|
||||
|
||||
$ sqlite-utils reset-counts mydb.db
|
||||
|
||||
.. _cli_vacuum:
|
||||
|
||||
Vacuum
|
||||
|
|
|
|||
|
|
@ -1768,6 +1768,12 @@ If the property is ``True`` any calls to the ``table.count`` property will first
|
|||
|
||||
Calling the ``.enable_counts()`` method on a database or table object will set ``use_counts_table`` to ``True`` for the lifetime of that database object.
|
||||
|
||||
If the ``_counts`` table ever becomes out-of-sync with the actual table counts you can repair it using the ``.reset_counts()`` method:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
db.reset_counts()
|
||||
|
||||
Creating indexes
|
||||
================
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue