searxng/searx/data/__main__.py
Markus Heiser 18a58943cc [mod] ExpireCacheSQLite - implement .setmany() for bulk loading
[1] https://github.com/searxng/searxng/issues/5223#issuecomment-3328597147

Suggested-by: Ivan G <igabaldon@inetol.net> [1]
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-09-28 07:32:41 +02:00

21 lines
418 B
Python

# 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()