feat: add SQLite stats database layer for CivitAI stats

Implements StatsDB class with upsert, batch upsert, get_by_hashes,
get_all, count, and close methods backed by a WAL-mode SQLite database.
Also guards __init__.py relative imports behind __package__ check so
pytest can run without ComfyUI context, and removes empty tests/__init__.py
to prevent pytest Package collector from traversing into the plugin root.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-15 14:29:59 +01:00
parent aefb129e07
commit 44088649d8
5 changed files with 271 additions and 30 deletions
+3
View File
@@ -0,0 +1,3 @@
# Root-level conftest: prevent pytest from collecting the package __init__.py
# as a test module (it uses relative imports that require ComfyUI context).
collect_ignore = ["__init__.py"]