lnd+paymentsdb: introduce harness for the payment sql backend

We prepare the code for the sql payment backend. However no
payment db interface method for the sql backend is implemented
yet. This will be done in the following commits. They currently
use the embedded KVStore to satify the build environment.
This commit is contained in:
ziggie committed 2026-02-25 08:01:14 +01:00
1 parent 0b00c66231
commit 93626822f7
4 files changed
+145 -23

No files matched your search

+11
View File
@@ -6,6 +6,8 @@ import (
"context"
"github.com/lightningnetwork/lnd/kvdb"
paymentsdb "github.com/lightningnetwork/lnd/payments/db"
"github.com/lightningnetwork/lnd/sqldb"
"github.com/lightningnetwork/lnd/sqldb/sqlc"
)
@@ -24,3 +26,12 @@ func (d *DefaultDatabaseBuilder) getSQLMigration(ctx context.Context,
return nil, false
}
// getPaymentsStore returns a paymentsdb.DB backed by a paymentsdb.KVStore
// implementation.
func (d *DefaultDatabaseBuilder) getPaymentsStore(_ *sqldb.BaseDB,
kvBackend kvdb.Backend,
opts ...paymentsdb.OptionModifier) (paymentsdb.DB, error) {
return paymentsdb.NewKVStore(kvBackend, opts...)
}