sqldb/sqlc: add NodeExists query

This commit is contained in:
Elle Mouton committed 2026-02-13 07:21:20 +02:00
1 parent 1738e0cabc
commit 5a3c013e91
3 files changed
+30

No files matched your search

+21
View File
@@ -3537,6 +3537,27 @@ func (q *Queries) ListNodesPaginated(ctx context.Context, arg ListNodesPaginated
return items, nil
}
const nodeExists = `-- name: NodeExists :one
SELECT EXISTS (
SELECT 1
FROM graph_nodes
WHERE pub_key = $1
AND version = $2
) AS node_exists
`
type NodeExistsParams struct {
PubKey []byte
Version int16
}
func (q *Queries) NodeExists(ctx context.Context, arg NodeExistsParams) (bool, error) {
row := q.db.QueryRowContext(ctx, nodeExists, arg.PubKey, arg.Version)
var node_exists bool
err := row.Scan(&node_exists)
return node_exists, err
}
const upsertChanPolicyExtraType = `-- name: UpsertChanPolicyExtraType :exec
/* ─────────────────────────────────────────────
graph_channel_policy_extra_types table queries