Files
pgbackweb/internal/service/webhooks/update_webhook.sql
Luis Eduardo Jeréz Girón c9ea76be56 Add webhooks mechanism
2024-08-18 23:02:25 -06:00

12 lines
450 B
SQL

-- name: WebhooksServiceUpdateWebhook :one
UPDATE webhooks
SET
name = COALESCE(sqlc.narg('name'), name),
is_active = COALESCE(sqlc.narg('is_active'), is_active),
target_ids = COALESCE(sqlc.narg('target_ids'), target_ids),
url = COALESCE(sqlc.narg('url'), url),
method = COALESCE(sqlc.narg('method'), method),
headers = COALESCE(sqlc.narg('headers'), headers),
body = COALESCE(sqlc.narg('body'), body)
WHERE id = @webhook_id
RETURNING *;