graph/db+sqldb: remove LEFT JOIN for fetching node addresses

In this commit, we remove the LEFT JOIN query that was used for fetching
a nodes addresses. The reason it was used before was to ensure that we'd
get an empty address list if the node did exist but had no addresses.
This was for the purposes of the `AddrsForNode` method since it needs to
return false/true to indicate if the given node exists.
This commit is contained in:
Elle Mouton committed 2025-07-30 18:11:01 +02:00
1 parent 43db6683d2
commit 5a1184c664
4 files changed
+54 -67

No files matched your search

+1 -1
View File
@@ -59,7 +59,7 @@ type Querier interface {
GetInvoiceHTLCs(ctx context.Context, invoiceID int64) ([]InvoiceHtlc, error)
GetKVInvoicePaymentHashByAddIndex(ctx context.Context, addIndex int64) ([]byte, error)
GetMigration(ctx context.Context, version int32) (time.Time, error)
GetNodeAddressesByPubKey(ctx context.Context, arg GetNodeAddressesByPubKeyParams) ([]GetNodeAddressesByPubKeyRow, error)
GetNodeAddresses(ctx context.Context, nodeID int64) ([]GetNodeAddressesRow, error)
GetNodeByPubKey(ctx context.Context, arg GetNodeByPubKeyParams) (GraphNode, error)
GetNodeFeatures(ctx context.Context, nodeID int64) ([]GraphNodeFeature, error)
GetNodeFeaturesByPubKey(ctx context.Context, arg GetNodeFeaturesByPubKeyParams) ([]int32, error)