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

lightningnetwork / lnd / 15973895448

30 Jun 2025 01:12PM UTC coverage: 67.627% (+0.05%) from 67.577%
15973895448

Pull #10007

github

web-flow
Merge a10fe7711 into 01dfee6f8
Pull Request #10007: graph/db: explicitly store bitfields for channel_update message & channel flags

0 of 65 new or added lines in 3 files covered. (0.0%)

40 existing lines in 12 files now uncovered.

135274 of 200031 relevant lines covered (67.63%)

21833.89 hits per line

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

81.82
/sqldb/sqlutils.go
1
package sqldb
2

3
import (
4
        "database/sql"
5
        "time"
6

7
        "golang.org/x/exp/constraints"
8
)
9

10
// NoOpReset is a no-op function that can be used as a default
11
// reset function ExecTx calls.
12
var NoOpReset = func() {}
22,435✔
13

14
// SQLInt16 turns a numerical integer type into the NullInt16 that sql/sqlc
15
// uses when an integer field can be permitted to be NULL.
16
//
17
// We use this constraints.Integer constraint here which maps to all signed and
18
// unsigned integer types.
NEW
19
func SQLInt16[T constraints.Integer](num T) sql.NullInt16 {
×
NEW
20
        return sql.NullInt16{
×
NEW
21
                Int16: int16(num),
×
NEW
22
                Valid: true,
×
NEW
23
        }
×
NEW
24
}
×
25

26
// SQLInt32 turns a numerical integer type into the NullInt32 that sql/sqlc
27
// uses when an integer field can be permitted to be NULL.
28
//
29
// We use this constraints.Integer constraint here which maps to all signed and
30
// unsigned integer types.
31
func SQLInt32[T constraints.Integer](num T) sql.NullInt32 {
20,592✔
32
        return sql.NullInt32{
20,592✔
33
                Int32: int32(num),
20,592✔
34
                Valid: true,
20,592✔
35
        }
20,592✔
36
}
20,592✔
37

38
// SQLInt64 turns a numerical integer type into the NullInt64 that sql/sqlc
39
// uses when an integer field can be permitted to be NULL.
40
//
41
// We use this constraints.Integer constraint here which maps to all signed and
42
// unsigned integer types.
43
func SQLInt64[T constraints.Integer](num T) sql.NullInt64 {
28,383✔
44
        return sql.NullInt64{
28,383✔
45
                Int64: int64(num),
28,383✔
46
                Valid: true,
28,383✔
47
        }
28,383✔
48
}
28,383✔
49

50
// SQLStr turns a string into the NullString that sql/sqlc uses when a string
51
// can be permitted to be NULL.
52
func SQLStr(s string) sql.NullString {
20,592✔
53
        if s == "" {
21,007✔
54
                return sql.NullString{}
415✔
55
        }
415✔
56

57
        return sql.NullString{
20,177✔
58
                String: s,
20,177✔
59
                Valid:  true,
20,177✔
60
        }
20,177✔
61
}
62

63
// SQLTime turns a time.Time into the NullTime that sql/sqlc uses when a time
64
// can be permitted to be NULL.
65
func SQLTime(t time.Time) sql.NullTime {
65,003✔
66
        return sql.NullTime{
65,003✔
67
                Time:  t,
65,003✔
68
                Valid: true,
65,003✔
69
        }
65,003✔
70
}
65,003✔
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