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

lightningnetwork / lnd / 12928527655

23 Jan 2025 11:48AM UTC coverage: 58.795% (+0.08%) from 58.714%
12928527655

push

github

web-flow
Merge pull request #8831 from bhandras/sql-invoice-migration

invoices: migrate KV invoices to native SQL for users of KV SQL backends

569 of 734 new or added lines in 12 files covered. (77.52%)

60 existing lines in 21 files now uncovered.

135996 of 231305 relevant lines covered (58.8%)

19277.79 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
        "time"
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) (int32, error) {
548✔
24
        row := q.db.QueryRowContext(ctx, getDatabaseVersion)
548✔
25
        var version int32
548✔
26
        err := row.Scan(&version)
548✔
27
        return version, err
548✔
28
}
548✔
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 int32) (time.Time, error) {
×
NEW
40
        row := q.db.QueryRowContext(ctx, getMigration, version)
×
NEW
41
        var migration_time time.Time
×
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       int32
54
        MigrationTime time.Time
55
}
56

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