Skip to main content

Module db

Module db 

Source

Functions§

clear_segment_read_locks
Clear any transient segment read-locks left over from a crash. clip/snapshot export set segments.locked = 1 while ffmpeg reads a segment and release it afterwards; if the process died mid-read those segments would stay locked (and never be pruned by retention). Clearing at startup makes the read-lock crash-safe. NOTE: this means locked is reserved for transient read-locks — a future durable evidence-hold must use a separate column, not this one.
init_pool
Open the SQLite pool with WAL + sane concurrency settings, creating the file if needed.
run_migrations
Apply embedded migrations from ./migrations.