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:
5 files changed
+324
-9
No files matched your search
@@ -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