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

lightningnetwork / lnd / 12203658024

06 Dec 2024 05:54PM UTC coverage: 58.965% (+9.2%) from 49.807%
12203658024

Pull #8831

github

bhandras
docs: update release notes for 0.19.0
Pull Request #8831: invoices: migrate KV invoices to native SQL for users of KV SQL backends

506 of 695 new or added lines in 12 files covered. (72.81%)

67 existing lines in 19 files now uncovered.

133874 of 227038 relevant lines covered (58.97%)

19659.95 hits per line

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

62.5
/sqldb/sqlc/migration.sql.go
1
// Code generated by sqlc. DO NOT EDIT.
2
// versions:
3
//   sqlc v1.25.0
4
// source: migration.sql
5

6
package sqlc
7

8
import (
9
        "context"
10
        "database/sql"
11
)
12

13
const getDatabaseVersion = `-- name: GetDatabaseVersion :one
14
SELECT
15
  version
16
FROM
17
  migration_tracker
18
ORDER BY
19
  version DESC
20
LIMIT 1
21
`
22

23
func (q *Queries) GetDatabaseVersion(ctx context.Context) (sql.NullInt32, error) {
542✔
24
        row := q.db.QueryRowContext(ctx, getDatabaseVersion)
542✔
25
        var version sql.NullInt32
542✔
26
        err := row.Scan(&version)
542✔
27
        return version, err
542✔
28
}
542✔
29

30
const getMigration = `-- name: GetMigration :one
31
SELECT
32
  migration_time
33
FROM
34
  migration_tracker
35
WHERE
36
  version = $1
37
`
38

NEW
39
func (q *Queries) GetMigration(ctx context.Context, version sql.NullInt32) (sql.NullTime, error) {
×
NEW
40
        row := q.db.QueryRowContext(ctx, getMigration, version)
×
NEW
41
        var migration_time sql.NullTime
×
NEW
42
        err := row.Scan(&migration_time)
×
NEW
43
        return migration_time, err
×
NEW
44
}
×
45

46
const setMigration = `-- name: SetMigration :exec
47
INSERT INTO
48
  migration_tracker (version, migration_time) 
49
VALUES ($1, $2)
50
`
51

52
type SetMigrationParams struct {
53
        Version       sql.NullInt32
54
        MigrationTime sql.NullTime
55
}
56

57
func (q *Queries) SetMigration(ctx context.Context, arg SetMigrationParams) error {
3,056✔
58
        _, err := q.db.ExecContext(ctx, setMigration, arg.Version, arg.MigrationTime)
3,056✔
59
        return err
3,056✔
60
}
3,056✔
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