feat: cache HLTB search responses

Store search results in hltb_cache (schema v8) with a 7-day TTL, cache misses too, prune rows older than 90 days, and add --cache-ttl, --no-cache and --clear-cache.
This commit is contained in:
strsv committed 2026-11-07 00:47:30 +03:00
1 parent e82d0e0f0a
commit 987e52931f
6 files changed
+216 -18

No files matched your search

+7
View File
@@ -113,6 +113,13 @@ CREATE TABLE IF NOT EXISTS moods (
updated_at TEXT
);
CREATE TABLE IF NOT EXISTS hltb_cache (
query TEXT PRIMARY KEY,
fetched_at TEXT NOT NULL,
results TEXT NOT NULL
);
CREATE INDEX IF NOT EXISTS idx_hltb_cache_fetched ON hltb_cache(fetched_at);
CREATE VIRTUAL TABLE IF NOT EXISTS game_fts USING fts5(
appid UNINDEXED,
name,