• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lightningnetwork / lnd / 14969904482

12 May 2025 10:28AM UTC coverage: 58.602%. First build
14969904482

Pull #9800

github

web-flow
Merge d1e39a77a into e8ac28067
Pull Request #9800: multi: various test preparations for different graph store impl

0 of 37 new or added lines in 5 files covered. (0.0%)

97486 of 166354 relevant lines covered (58.6%)

1.82 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/graph/db/sql_store.go
1
package graphdb
2

3
import (
4
        "github.com/lightningnetwork/lnd/sqldb"
5
)
6

7
// SQLQueries is a subset of the sqlc.Querier interface that can be used to
8
// execute queries against the SQL graph tables.
9
type SQLQueries interface {
10
}
11

12
// BatchedSQLQueries is a version of SQLQueries that's capable of batched
13
// database operations.
14
type BatchedSQLQueries interface {
15
        SQLQueries
16
        sqldb.BatchedTx[SQLQueries]
17
}
18

19
// SQLStore is an implementation of the V1Store interface that uses a SQL
20
// database as the backend.
21
//
22
// NOTE: currently, this temporarily embeds the KVStore struct so that we can
23
// implement the V1Store interface incrementally. For any method not
24
// implemented,  things will fall back to the KVStore. This is ONLY the case
25
// for the time being while this struct is purely used in unit tests only.
26
type SQLStore struct {
27
        db BatchedSQLQueries
28

29
        // Temporary fall-back to the KVStore so that we can implement the
30
        // interface incrementally.
31
        *KVStore
32
}
33

34
// A compile-time assertion to ensure that SQLStore implements the V1Store
35
// interface.
36
var _ V1Store = (*SQLStore)(nil)
37

38
// NewSQLStore creates a new SQLStore instance given an open BatchedSQLQueries
39
// storage backend.
NEW
40
func NewSQLStore(db BatchedSQLQueries, kvStore *KVStore) *SQLStore {
×
NEW
41
        return &SQLStore{
×
NEW
42
                db:      db,
×
NEW
43
                KVStore: kvStore,
×
NEW
44
        }
×
NEW
45
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc