chore(channels): name the SQLite database clipwright.sqlite3
All checks were successful
CI / unit (push) Successful in 49s
CI / backend-e2e (push) Successful in 1m26s
CI / dashboard-e2e (push) Successful in 2m30s

Make the file type explicit. CLIPWRIGHT_DB still overrides the path.
This commit is contained in:
pedro-bento 2026-10-06 12:13:25 +01:00
parent d6275aab4c
commit 71e0ebf7ea
4 changed files with 8 additions and 8 deletions

8
.gitignore vendored
View file

@ -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

View file

@ -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`` (``<repo>/clipwright.db``). A one-time
``clipwright.storage.channel_profiles`` (``<repo>/clipwright.sqlite3``). A one-time
migration imports the legacy ``<repo>/channels/<slug>.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,

View file

@ -5,7 +5,7 @@ committed ``channels/<slug>.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 ``<repo>/clipwright.db``.
lives at ``<repo>/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:

View file

@ -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.