-- name: GetNormalizationPrefs :one SELECT mode, target_lufs, boost, updated_at FROM user_normalization_prefs WHERE user_id = $1; -- name: UpsertNormalizationPrefs :one -- Whole-row write from either client; the CHECKs in migration 0067 back the -- handler's own validation. INSERT INTO user_normalization_prefs (user_id, mode, target_lufs, boost) VALUES (sqlc.arg(user_id), sqlc.arg(mode), sqlc.arg(target_lufs), sqlc.arg(boost)) ON CONFLICT (user_id) DO UPDATE SET mode = EXCLUDED.mode, target_lufs = EXCLUDED.target_lufs, boost = EXCLUDED.boost, updated_at = now() RETURNING mode, target_lufs, boost, updated_at;