clipper/backend/sql/queries.sql

16 lines
638 B
MySQL
Raw Normal View History

2021-11-01 05:28:40 +00:00
-- name: GetMediaSet :one
SELECT * FROM media_sets WHERE id = $1;
-- name: GetMediaSetByYoutubeID :one
SELECT * FROM media_sets WHERE youtube_id = $1;
-- name: CreateMediaSet :one
2021-11-02 16:20:47 +00:00
INSERT INTO media_sets (youtube_id, audio_youtube_itag, audio_channels, audio_frames_approx, audio_sample_rate, audio_mime_type_encoded, video_youtube_itag, video_mime_type, video_duration_nanos, created_at, updated_at)
2021-11-01 05:28:40 +00:00
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, NOW(), NOW())
RETURNING *;
2021-11-02 16:20:47 +00:00
-- name: SetAudioUploaded :one
UPDATE media_sets
SET audio_s3_bucket = $1, audio_s3_key = $2, audio_s3_uploaded_at = NOW(), updated_at = NOW()
RETURNING *;