Persist transcripts in SQLite #38
Loading…
Reference in a new issue
No description provided.
Delete branch "split-5"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Replace the in-memory store with the SQLite store so transcripts
survive restarts. The initial migration creates three tables:
transcripts holds stable metadata (slug, title, meeting date, YouTube
video ID, creation time), speakers holds each transcript's speaker IDs
and names, and transcripts_contents holds append-only revisions of the
segment array as JSON with a last_modified timestamp.
Import writes the metadata, speakers, and first revision in one
transaction and returns ErrTranscriptExists when the slug is taken.
Segment edits locate the segment with json_each, build the new array
with json_set, and insert it as a new revision inside a serializable
transaction, so earlier revisions are never modified. The revision
with the greatest ID is current, which avoids depending on wall-clock
ordering. Timestamps use RFC3339Nano so reads round-trip exactly.
Transcript gains Created and LastModified, which the store populates
from the metadata row and the current revision. test_sqlite exposes a
direct database connection and a controllable clock so store tests
can verify revision counts and stored JSON. Handler tests now run
against SQLite, and the memory store package is removed. DESIGN.md
documents the storage model.
Validation: dev-scripts/build-all-flake-targets
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.