* started schema * db schemas beginning * first db schema gen * added sqlc generation with go generate and sqlite driver * i think these dependencies are needed * added IF NOT EXISTS to create and CRUD for each table * fixed missing columns * added missing field * fixed code generation with sqlc
18 lines
440 B
SQL
18 lines
440 B
SQL
-- 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 =?;
|
|
|