docs(06-03): add SAFETY comments to all 12 hand-crafted SQL statements

- 7 SAFETY comments in search.go (FTS5 MATCH/INSERT/DELETE operations)
- 3 SAFETY comments in library.go (FTS5 INSERT/DELETE in commitNewAudioFile, updateAudioFileMetadata)
- 1 SAFETY comment in rescan.go (FTS5 DELETE in clearAllLibraryData)
- 1 SAFETY comment in persistence.go (variable-count multi-row INSERT)
- Cross-references link library.go/rescan.go back to search.go
- Two-part format: why sqlc can't handle it + what makes it safe
This commit is contained in:
2026-03-04 19:33:55 -05:00
parent 2221a68459
commit 7dfe003e63
4 changed files with 12 additions and 0 deletions
+1
View File
@@ -161,6 +161,7 @@ func (l *Library) clearLibraryTables() error {
}
// Clear FTS5 search index.
// SAFETY: FTS5 virtual table, see search.go:ClearSearchIndex. No parameters; unconditional delete.
if _, err := tx.ExecContext(
l.ctx, `DELETE FROM search_index`,
); err != nil {