// Code generated by sqlc. DO NOT EDIT. // versions: // sqlc v1.31.1 package webhookdb import ( "context" "github.com/jackc/pgx/v5/pgtype" ) type Querier interface { AutoDisableWebhook(ctx context.Context, db DBTX, arg AutoDisableWebhookParams) error // Hot-path for the deliver worker: picks up to $1 rows that are // pending or in retry-ready state, FOR UPDATE SKIP LOCKED so concurrent // workers don't double-send. The deliverer marks the row 'pending' // with a far-future next_retry_at while it works on it (defense // against re-claim during a long HTTP timeout). ClaimDueDeliveries(ctx context.Context, db DBTX, limit int32) ([]int64, error) CreateDelivery(ctx context.Context, db DBTX, arg CreateDeliveryParams) (WebhookDelivery, error) // SPDX-License-Identifier: AGPL-3.0-or-later // // Query surface for the webhook package. Naming mirrors the verb the // caller uses; visibility / ownership filters are applied by the // handler layer (the queries are deliberately narrow on key columns). CreateWebhook(ctx context.Context, db DBTX, arg CreateWebhookParams) (Webhook, error) DeleteWebhook(ctx context.Context, db DBTX, id int64) error GetDeliveryByID(ctx context.Context, db DBTX, id int64) (WebhookDelivery, error) // Resolve a repo's owner so the fanout knows which webhooks to fire. // Returns owner_kind 'user' or 'org' so the matcher knows what bucket // to look in. (We use 'user' as a literal string here; the webhook // machinery itself only stores 'repo'/'org' as owners — repo-owned // webhooks attach to the repo regardless of who owns the repo.) GetRepoOwnerKindForFanout(ctx context.Context, db DBTX, id int64) (GetRepoOwnerKindForFanoutRow, error) GetWebhookByID(ctx context.Context, db DBTX, id int64) (Webhook, error) // SPDX-License-Identifier: AGPL-3.0-or-later // // Webhook fanout reads the same domain_events / cursor surface that // notifications do — but with its own consumer row so progress // doesn't collide with notify_fanout. GetWebhookCursor(ctx context.Context, db DBTX, consumer string) (DomainEventsProcessed, error) // Used by fanout to find subscribers for an event. ListActiveWebhooksForOwner(ctx context.Context, db DBTX, arg ListActiveWebhooksForOwnerParams) ([]Webhook, error) ListDeliveriesForWebhook(ctx context.Context, db DBTX, arg ListDeliveriesForWebhookParams) ([]ListDeliveriesForWebhookRow, error) ListUnprocessedDomainEvents(ctx context.Context, db DBTX, arg ListUnprocessedDomainEventsParams) ([]DomainEvent, error) ListWebhooksForOwner(ctx context.Context, db DBTX, arg ListWebhooksForOwnerParams) ([]Webhook, error) MarkDeliveryPermanentFailure(ctx context.Context, db DBTX, arg MarkDeliveryPermanentFailureParams) error MarkDeliveryRetry(ctx context.Context, db DBTX, arg MarkDeliveryRetryParams) error MarkDeliverySucceeded(ctx context.Context, db DBTX, arg MarkDeliverySucceededParams) error // Cron: drops terminal deliveries older than the retention window. // pending/failed_retry rows are left alone so an in-flight retry isn't // aborted out from under the worker. PurgeOldDeliveries(ctx context.Context, db DBTX, retention pgtype.Interval) (int64, error) // Increments the failure counter and reports the new value so the // caller can decide whether to auto-disable. RecordWebhookFailure(ctx context.Context, db DBTX, id int64) (RecordWebhookFailureRow, error) RecordWebhookSuccess(ctx context.Context, db DBTX, id int64) error // Re-enables a previously auto-disabled webhook (UI affordance). // Resets the failure counter and clears disabled_at/reason. SetWebhookActive(ctx context.Context, db DBTX, arg SetWebhookActiveParams) error SetWebhookCursor(ctx context.Context, db DBTX, arg SetWebhookCursorParams) error UpdateWebhook(ctx context.Context, db DBTX, arg UpdateWebhookParams) error UpdateWebhookSecret(ctx context.Context, db DBTX, arg UpdateWebhookSecretParams) error } var _ Querier = (*Queries)(nil)