blob: 8e78527514e6144d39c626282ca396eee513e4b4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Command line implementation"""
import typer
from .core import get_cache
app = typer.Typer()
@app.command()
def state():
"""show state of the cache"""
cache = get_cache()
for table in cache.table_names:
for row in cache.DB.execute(f"SELECT count(*) FROM {table}"):
print(f"cache table {table} holds {row[0]} key/value pairs")
app()
|