From 71e0ebf7eaf7ee5da918e3e83a00c8f3c181e975 Mon Sep 17 00:00:00 2001 From: pedro-bento Date: Tue, 6 Oct 2026 12:13:25 +0100 Subject: [PATCH] chore(channels): name the SQLite database clipwright.sqlite3 Make the file type explicit. CLIPWRIGHT_DB still overrides the path. --- .gitignore | 8 ++++---- clipwright/pipeline/profiles.py | 2 +- clipwright/storage/channel_profiles.py | 4 ++-- tests/conftest.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 8e56070..92b3fe0 100644 --- a/.gitignore +++ b/.gitignore @@ -16,13 +16,13 @@ __pycache__/ uploads/ output/ -# Legacy channel profile source (migrated into clipwright.db on first run) +# Legacy channel profile source (migrated into clipwright.sqlite3 on first run) channels/ # Local SQLite runtime state -clipwright.db -clipwright.db-wal -clipwright.db-shm +clipwright.sqlite3 +clipwright.sqlite3-wal +clipwright.sqlite3-shm # OS / IDE .DS_Store diff --git a/clipwright/pipeline/profiles.py b/clipwright/pipeline/profiles.py index 1c943b2..af99650 100644 --- a/clipwright/pipeline/profiles.py +++ b/clipwright/pipeline/profiles.py @@ -7,7 +7,7 @@ loader and the ``CHANNEL_PROFILE`` plumbing only -- nothing here changes how titles, hooks or descriptions are generated yet. The runtime source of truth is the SQLite store in -``clipwright.storage.channel_profiles`` (``/clipwright.db``). A one-time +``clipwright.storage.channel_profiles`` (``/clipwright.sqlite3``). A one-time migration imports the legacy ``/channels/.json`` files on first bootstrap; ``channels_dir`` remains a test/embedding seam that reads straight from a directory. Every field is optional and falls back to a sensible default, diff --git a/clipwright/storage/channel_profiles.py b/clipwright/storage/channel_profiles.py index 9d2e22a..273b145 100644 --- a/clipwright/storage/channel_profiles.py +++ b/clipwright/storage/channel_profiles.py @@ -5,7 +5,7 @@ committed ``channels/.json`` files: on the very first bootstrap (the ``seeded`` key is absent from ``meta``) any profile files that the file loader still accepts are imported once, then the guard is set so later runs never re-read the directory. Set ``CLIPWRIGHT_DB`` to move the database; otherwise it -lives at ``/clipwright.db``. +lives at ``/clipwright.sqlite3``. Threading: FastAPI sync endpoints run in a threadpool, so every public operation is serialized by a module-level re-entrant lock. The pipeline runs in @@ -45,7 +45,7 @@ def db_path() -> Path: override = os.environ.get("CLIPWRIGHT_DB") if override: return Path(override) - return REPO_ROOT / "clipwright.db" + return REPO_ROOT / "clipwright.sqlite3" def _connect() -> sqlite3.Connection: diff --git a/tests/conftest.py b/tests/conftest.py index 4e6ac53..d3e58e9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -106,7 +106,7 @@ def _channel_profile_db(tmp_path_factory): from clipwright.pipeline import profiles db_dir = tmp_path_factory.mktemp("channel-db") - os.environ["CLIPWRIGHT_DB"] = str(db_dir / "clipwright.db") + os.environ["CLIPWRIGHT_DB"] = str(db_dir / "clipwright.sqlite3") try: # First ``save_profile`` also runs the one-time file migration, but we # seed explicitly so the DB never depends on the checkout's files.