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 committed 2025-06-18 16:54:59 +02:00
1 parent d60761f79c
commit 8af32951c7
5 files changed
+183 -3

No files matched your search

+7 -1
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,