sqldb+graph/db: implement FilterChannelRange

This lets us run `TestFilterChannelRange` against the SQL backends.
This commit is contained in:
Elle Mouton
2025-06-11 16:47:07 +02:00
parent ff84fa1cb2
commit 3687171cd5
6 changed files with 235 additions and 1 deletions

View File

@@ -317,6 +317,13 @@ FROM channels c
WHERE c.version = $1
AND (c.node_id_1 = $2 OR c.node_id_2 = $2);
-- name: GetPublicV1ChannelsBySCID :many
SELECT *
FROM channels
WHERE node_1_signature IS NOT NULL
AND scid >= @start_scid
AND scid < @end_scid;
-- name: ListChannelsWithPoliciesPaginated :many
SELECT
sqlc.embed(c),
@@ -420,6 +427,13 @@ ON CONFLICT (channel_id, node_id, version)
WHERE EXCLUDED.last_update > channel_policies.last_update
RETURNING id;
-- name: GetChannelPolicyByChannelAndNode :one
SELECT *
FROM channel_policies
WHERE channel_id = $1
AND node_id = $2
AND version = $3;
/* ─────────────────────────────────────────────
channel_policy_extra_types table queries
─────────────────────────────────────────────