mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 17:34:32 +02:00
db.enable_counts() method, closes #213
This commit is contained in:
parent
1cad7fad3e
commit
9a5c92b63e
3 changed files with 55 additions and 3 deletions
|
|
@ -1706,6 +1706,12 @@ This will create the ``_counts`` table if it does not already exist, with the fo
|
|||
|
||||
Once enabled, table counts can be accessed by querying the ``counts`` table. The count records will be automatically kept up-to-date by the triggers when rows are added or deleted to the table.
|
||||
|
||||
You can enable cached counts for every table in a database (except for virtual tables and the ``_counts`` table itself) using the database ``enable_counts()`` method:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
db.enable_counts()
|
||||
|
||||
Creating indexes
|
||||
================
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue