added IF NOT EXISTS to create and CRUD for each table

This commit is contained in:
2025-04-16 12:12:17 -05:00
parent faa25fe745
commit c20cac4015
18 changed files with 161 additions and 11 deletions
@@ -0,0 +1,17 @@
-- name: CreateAudioFile :one
INSERT INTO audio_files (file_path, length_milliseconds, file_type_id, recording_id) VALUES (?, ?, ?, ?)
RETURNING *;
-- name: GetAudioFile :one
SELECT * FROM audio_files
WHERE id = ? LIMIT 1;
-- name: UpdateAudioFile :exec
UPDATE audio_files
SET file_path = ?, length_milliseconds = ?, file_type_id = ?, recording_id = ?
WHERE id =?;
-- name: DeleteAudioFile :exec
DELETE FROM audio_files
WHERE id =?;