mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-09 15:04:39 +02:00
graph/db: implement ForEachNodeDirectedChannel and ForEachNodeCacheable
Here we add the `ForEachNodeDirectedChannel` and `ForEachNodeCacheable` SQLStore implementations which then lets us run `TestGraphTraversalCacheable` and `TestGraphCacheForEachNodeChannel` against SQL backends.
This commit is contained in:
@ -27,6 +27,12 @@ FROM nodes
|
||||
WHERE pub_key = $1
|
||||
AND version = $2;
|
||||
|
||||
-- name: GetNodeIDByPubKey :one
|
||||
SELECT id
|
||||
FROM nodes
|
||||
WHERE pub_key = $1
|
||||
AND version = $2;
|
||||
|
||||
-- name: ListNodesPaginated :many
|
||||
SELECT *
|
||||
FROM nodes
|
||||
@ -34,6 +40,13 @@ WHERE version = $1 AND id > $2
|
||||
ORDER BY id
|
||||
LIMIT $3;
|
||||
|
||||
-- name: ListNodeIDsAndPubKeys :many
|
||||
SELECT id, pub_key
|
||||
FROM nodes
|
||||
WHERE version = $1 AND id > $2
|
||||
ORDER BY id
|
||||
LIMIT $3;
|
||||
|
||||
-- name: DeleteNodeByPubKey :execresult
|
||||
DELETE FROM nodes
|
||||
WHERE pub_key = $1
|
||||
|
Reference in New Issue
Block a user