graph/db+sqldb: implement ForEachNode

In this commit the `ForEachNode` method is added to the SQLStore. With
this, the `TestGraphCacheTraversal` unit test can be run against SQL
backends.
This commit is contained in:
Elle Mouton
2025-06-11 15:59:43 +02:00
parent d60761f79c
commit 8af32951c7
5 changed files with 183 additions and 3 deletions

View File

@@ -27,6 +27,13 @@ FROM nodes
WHERE pub_key = $1
AND version = $2;
-- name: ListNodesPaginated :many
SELECT *
FROM nodes
WHERE version = $1 AND id > $2
ORDER BY id
LIMIT $3;
-- name: DeleteNodeByPubKey :execresult
DELETE FROM nodes
WHERE pub_key = $1
@@ -194,7 +201,6 @@ ORDER BY scid DESC
LIMIT 1;
-- name: ListChannelsByNodeID :many
SELECT sqlc.embed(c),
n1.pub_key AS node1_pubkey,
n2.pub_key AS node2_pubkey,