mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 09:24:31 +02:00
table.has_counts_triggers property, refs #219
This commit is contained in:
parent
c265541384
commit
b4f09146d3
4 changed files with 46 additions and 4 deletions
|
|
@ -571,6 +571,20 @@ def enable_counts(path, tables, load_extension):
|
|||
db[table].enable_counts()
|
||||
|
||||
|
||||
@cli.command(name="reset-counts")
|
||||
@click.argument(
|
||||
"path",
|
||||
type=click.Path(exists=True, file_okay=True, dir_okay=False, allow_dash=False),
|
||||
required=True,
|
||||
)
|
||||
@load_extension_option
|
||||
def reset_counts(path, load_extension):
|
||||
"Reset calculated counts in the _counts table"
|
||||
db = sqlite_utils.Database(path)
|
||||
_load_extensions(db, load_extension)
|
||||
db.reset_counts()
|
||||
|
||||
|
||||
def insert_upsert_options(fn):
|
||||
for decorator in reversed(
|
||||
(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue