chore(channels): name the SQLite database clipwright.sqlite3
Make the file type explicit. CLIPWRIGHT_DB still overrides the path.
This commit is contained in:
parent
d6275aab4c
commit
71e0ebf7ea
4 changed files with 8 additions and 8 deletions
8
.gitignore
vendored
8
.gitignore
vendored
|
|
@ -16,13 +16,13 @@ __pycache__/
|
||||||
uploads/
|
uploads/
|
||||||
output/
|
output/
|
||||||
|
|
||||||
# Legacy channel profile source (migrated into clipwright.db on first run)
|
# Legacy channel profile source (migrated into clipwright.sqlite3 on first run)
|
||||||
channels/
|
channels/
|
||||||
|
|
||||||
# Local SQLite runtime state
|
# Local SQLite runtime state
|
||||||
clipwright.db
|
clipwright.sqlite3
|
||||||
clipwright.db-wal
|
clipwright.sqlite3-wal
|
||||||
clipwright.db-shm
|
clipwright.sqlite3-shm
|
||||||
|
|
||||||
# OS / IDE
|
# OS / IDE
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ loader and the ``CHANNEL_PROFILE`` plumbing only -- nothing here changes how
|
||||||
titles, hooks or descriptions are generated yet.
|
titles, hooks or descriptions are generated yet.
|
||||||
|
|
||||||
The runtime source of truth is the SQLite store in
|
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
|
migration imports the legacy ``<repo>/channels/<slug>.json`` files on first
|
||||||
bootstrap; ``channels_dir`` remains a test/embedding seam that reads straight
|
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,
|
from a directory. Every field is optional and falls back to a sensible default,
|
||||||
|
|
|
||||||
|
|
@ -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
|
``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
|
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
|
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
|
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
|
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")
|
override = os.environ.get("CLIPWRIGHT_DB")
|
||||||
if override:
|
if override:
|
||||||
return Path(override)
|
return Path(override)
|
||||||
return REPO_ROOT / "clipwright.db"
|
return REPO_ROOT / "clipwright.sqlite3"
|
||||||
|
|
||||||
|
|
||||||
def _connect() -> sqlite3.Connection:
|
def _connect() -> sqlite3.Connection:
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ def _channel_profile_db(tmp_path_factory):
|
||||||
from clipwright.pipeline import profiles
|
from clipwright.pipeline import profiles
|
||||||
|
|
||||||
db_dir = tmp_path_factory.mktemp("channel-db")
|
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:
|
try:
|
||||||
# First ``save_profile`` also runs the one-time file migration, but we
|
# First ``save_profile`` also runs the one-time file migration, but we
|
||||||
# seed explicitly so the DB never depends on the checkout's files.
|
# seed explicitly so the DB never depends on the checkout's files.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue