From 18a58943ccaa324b39232fa503462eb39f407399 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Wed, 24 Sep 2025 19:34:03 +0200 Subject: [mod] ExpireCacheSQLite - implement .setmany() for bulk loading [1] https://github.com/searxng/searxng/issues/5223#issuecomment-3328597147 Suggested-by: Ivan G [1] Signed-off-by: Markus Heiser --- searx/data/__main__.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 searx/data/__main__.py (limited to 'searx/data/__main__.py') diff --git a/searx/data/__main__.py b/searx/data/__main__.py new file mode 100644 index 000000000..8e7852751 --- /dev/null +++ b/searx/data/__main__.py @@ -0,0 +1,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() -- cgit v1.2.3