Skip to content

Commit e53f69a

Browse files
committed
multi: add relevant queries for QueryPayments implemenation
1 parent 75b3a35 commit e53f69a

File tree

4 files changed

+939
-0
lines changed

4 files changed

+939
-0
lines changed

payments/db/sql_store.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,33 @@
11
package paymentsdb
22

33
import (
4+
"context"
45
"fmt"
56

67
"github.com/lightningnetwork/lnd/sqldb"
8+
"github.com/lightningnetwork/lnd/sqldb/sqlc"
79
)
810

911
// SQLQueries is a subset of the sqlc.Querier interface that can be used to
1012
// execute queries against the SQL payments tables.
1113
type SQLQueries interface {
14+
/*
15+
Payment DB read operations.
16+
*/
17+
FilterPayments(ctx context.Context, query sqlc.FilterPaymentsParams) ([]sqlc.FilterPaymentsRow, error)
18+
FetchPayment(ctx context.Context, paymentIdentifier []byte) (sqlc.FetchPaymentRow, error)
19+
FetchPayments(ctx context.Context, paymentIdentifiers [][]byte) ([]sqlc.FetchPaymentsRow, error)
20+
21+
CountPayments(ctx context.Context) (int64, error)
22+
23+
FetchHtlcAttemptsForPayment(ctx context.Context, query sqlc.FetchHtlcAttemptsForPaymentParams) ([]sqlc.FetchHtlcAttemptsForPaymentRow, error)
24+
FetchAllInflightAttempts(ctx context.Context) ([]sqlc.PaymentHtlcAttempt, error)
25+
FetchHopsForAttempt(ctx context.Context, htlcAttemptIndex int64) ([]sqlc.FetchHopsForAttemptRow, error)
26+
FetchHopsForAttempts(ctx context.Context, htlcAttemptIndices []int64) ([]sqlc.FetchHopsForAttemptsRow, error)
27+
28+
FetchPaymentLevelFirstHopCustomRecords(ctx context.Context, paymentID int64) ([]sqlc.FetchPaymentLevelFirstHopCustomRecordsRow, error)
29+
FetchRouteLevelFirstHopCustomRecords(ctx context.Context, htlcAttemptIndices []int64) ([]sqlc.FetchRouteLevelFirstHopCustomRecordsRow, error)
30+
FetchHopLevelCustomRecords(ctx context.Context, hopIDs []int64) ([]sqlc.FetchHopLevelCustomRecordsRow, error)
1231
}
1332

1433
// BatchedSQLQueries is a version of the SQLQueries that's capable

0 commit comments

Comments
 (0)