refactor(state): delete the unused ArmedBindingsForSource RPC and query
deploy / plan (push) Failing after 2s
deploy / gate (push) Skipped
deploy / archied-image (push) Skipped
deploy / agent-image (push) Skipped
deploy / dist-zip (push) Skipped

This commit is contained in:
sam committed 2026-11-09 01:22:02 +11:00
1 parent 90c7d137fb
commit 472478cf83
10 files changed
+54 -308

No files matched your search

@@ -12,72 +12,6 @@ import (
"github.com/jackc/pgx/v5/pgtype"
)
const armedBindingsForSource = `-- name: ArmedBindingsForSource :many
SELECT id, name, source, mapping, workflow, owner, repo, version, status, created_at, updated_at, filter, inputs, repo_param, org_id, workspace_id
FROM bindings WHERE source = $1 AND status = 'armed' AND ($2::text IS NULL OR org_id = $2) ORDER BY created_at DESC
`
type ArmedBindingsForSourceParams struct {
Source string
ScopeOrg pgtype.Text
}
type ArmedBindingsForSourceRow struct {
ID string
Name string
Source string
Mapping string
Workflow string
Owner string
Repo string
Version int64
Status string
CreatedAt time.Time
UpdatedAt time.Time
Filter string
Inputs string
RepoParam string
OrgID string
WorkspaceID string
}
func (q *Queries) ArmedBindingsForSource(ctx context.Context, arg ArmedBindingsForSourceParams) ([]ArmedBindingsForSourceRow, error) {
rows, err := q.db.Query(ctx, armedBindingsForSource, arg.Source, arg.ScopeOrg)
if err != nil {
return nil, err
}
defer rows.Close()
var items []ArmedBindingsForSourceRow
for rows.Next() {
var i ArmedBindingsForSourceRow
if err := rows.Scan(
&i.ID,
&i.Name,
&i.Source,
&i.Mapping,
&i.Workflow,
&i.Owner,
&i.Repo,
&i.Version,
&i.Status,
&i.CreatedAt,
&i.UpdatedAt,
&i.Filter,
&i.Inputs,
&i.RepoParam,
&i.OrgID,
&i.WorkspaceID,
); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const captureRefusalSummary = `-- name: CaptureRefusalSummary :many
WITH r AS (
SELECT source, count(*) AS refused, array_agg(DISTINCT addr ORDER BY addr)::text[] AS addrs