// Code generated by sqlc. DO NOT EDIT. // versions: // sqlc v1.31.1 // source: normalization_prefs.sql package dbq import ( "context" "github.com/jackc/pgx/v5/pgtype" ) const getNormalizationPrefs = `-- name: GetNormalizationPrefs :one SELECT mode, target_lufs, boost, updated_at FROM user_normalization_prefs WHERE user_id = $1 ` type GetNormalizationPrefsRow struct { Mode string TargetLufs int16 Boost string UpdatedAt pgtype.Timestamptz } func (q *Queries) GetNormalizationPrefs(ctx context.Context, userID pgtype.UUID) (GetNormalizationPrefsRow, error) { row := q.db.QueryRow(ctx, getNormalizationPrefs, userID) var i GetNormalizationPrefsRow err := row.Scan( &i.Mode, &i.TargetLufs, &i.Boost, &i.UpdatedAt, ) return i, err } const upsertNormalizationPrefs = `-- name: UpsertNormalizationPrefs :one INSERT INTO user_normalization_prefs (user_id, mode, target_lufs, boost) VALUES ($1, $2, $3, $4) 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 ` type UpsertNormalizationPrefsParams struct { UserID pgtype.UUID Mode string TargetLufs int16 Boost string } type UpsertNormalizationPrefsRow struct { Mode string TargetLufs int16 Boost string UpdatedAt pgtype.Timestamptz } // Whole-row write from either client; the CHECKs in migration 0067 back the // handler's own validation. func (q *Queries) UpsertNormalizationPrefs(ctx context.Context, arg UpsertNormalizationPrefsParams) (UpsertNormalizationPrefsRow, error) { row := q.db.QueryRow(ctx, upsertNormalizationPrefs, arg.UserID, arg.Mode, arg.TargetLufs, arg.Boost, ) var i UpsertNormalizationPrefsRow err := row.Scan( &i.Mode, &i.TargetLufs, &i.Boost, &i.UpdatedAt, ) return i, err }