Skip to content

Commit b2414ad

Browse files
committed
multi: add relevant queries for QueryPayments implemenation
1 parent 18f03ec commit b2414ad

File tree

4 files changed

+776
-0
lines changed

4 files changed

+776
-0
lines changed

payments/db/sql_store.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,32 @@
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+
FetchPaymentsByIDs(ctx context.Context, paymentIDs []int64) ([]sqlc.FetchPaymentsByIDsRow, error)
20+
21+
CountPayments(ctx context.Context) (int64, error)
22+
23+
FetchHtlcAttemptsForPayments(ctx context.Context, paymentIDs []int64) ([]sqlc.FetchHtlcAttemptsForPaymentsRow, error)
24+
FetchAllInflightAttempts(ctx context.Context) ([]sqlc.PaymentHtlcAttempt, error)
25+
FetchHopsForAttempts(ctx context.Context, htlcAttemptIndices []int64) ([]sqlc.FetchHopsForAttemptsRow, error)
26+
27+
FetchPaymentLevelFirstHopCustomRecords(ctx context.Context, paymentIDs []int64) ([]sqlc.PaymentFirstHopCustomRecord, error)
28+
FetchRouteLevelFirstHopCustomRecords(ctx context.Context, htlcAttemptIndices []int64) ([]sqlc.PaymentAttemptFirstHopCustomRecord, error)
29+
FetchHopLevelCustomRecords(ctx context.Context, hopIDs []int64) ([]sqlc.PaymentHopCustomRecord, error)
1230
}
1331

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

0 commit comments

Comments
 (0)