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:
@@ -151,6 +151,7 @@ func (q *Queue) insertTrackBatch(tx *sql.Tx, batch []Track) error {
|
||||
args = append(args, track.AudioFileID, track.Position)
|
||||
}
|
||||
|
||||
// SAFETY: Multi-row INSERT with variable row count unsupported by sqlc. Placeholder count matches args length; no string interpolation.
|
||||
query := "INSERT INTO queue_tracks (audio_file_id, position) VALUES " +
|
||||
strings.Join(valuePlaceholders, ",")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user