The local SQLite database powers cache lookups, history, stats, and export tracking.
Tables at a glance
video
Core metadata per video id.
transcript
Cached transcript payload and language.
runstats
Token, cost, and timing telemetry per run.
exportrecord
Transcript export format and path history.
Table schemas
video
One row per processed video id.
| Column | Type | Notes |
|---|---|---|
id | string (PK) | YouTube video id |
title | string | Video title at processing time |
duration | int | Duration in seconds |
cached_at | datetime | Last cache write timestamp |
transcript
Transcript text cache — unique per video.
| Column | Type | Notes |
|---|---|---|
id | int (PK) | Auto increment |
video_id | string (FK → video.id) | Indexed, unique constraint |
content | string | Full transcript text |
language | string | Language code |
runstats
Per-run usage and timing telemetry.
| Column | Type | Notes |
|---|---|---|
id | int (PK) | Auto increment |
video_id | string (FK → video.id) | Indexed |
tokens_used | int | Total tokens |
prompt_tokens | int | Prompt tokens |
completion_tokens | int | Completion tokens |
cost_usd | float | Estimated cost |
model | string | Model used |
transcript_seconds | float | Transcript fetch time |
generation_seconds | float | Generation time |
timestamp | datetime | Run timestamp |
exportrecord
Tracks transcript export files.
| Column | Type | Notes |
|---|---|---|
id | int (PK) | Auto increment |
video_id | string (FK → video.id) | Indexed |
format | string | txt or json |
output_path | string | Absolute or resolved output path |
timestamp | datetime | Export timestamp |
Relationships
Operational notes
- Cache reads drive
stats,history, and skip-if-processed logic. - Clearing the cache removes database records only — generated note files on disk are not affected.
- Schema migrations are managed in
src/notewise/storage/migrations.py(no Alembic).