multi: use published sqldb/v2 dependency

Update the `sqldb/v2` dependency in go.mod to the published version, and
update the litd code to adhere to the new changes in the `sqldb/v2`
package.

Given that the official `sqldb/v2` package is now used, we can also
remove the `sqldb/v1` dependency from the go.mod file, as it is no
longer used in the codebase.
This commit is contained in:
Viktor Torstensson 2026-03-26 11:50:34 +01:00
parent 911c3bb5d1
commit 10337691cb
No known key found for this signature in database
GPG key ID: 961CC8259AE675D4
5 changed files with 15 additions and 19 deletions

View file

@ -30,8 +30,8 @@ const (
// NOTE: This function is not located in the migstreams package to avoid
// cyclic dependencies. This test migration stream does not run the kvdb to sql
// migration, as we already have separate unit tests which tests the migration.
func MakeTestMigrationStreams() []sqldb.MigrationStream {
migStream := sqldb.MigrationStream{
func MakeTestMigrationStreams() []sqldb.MigrationSet {
migStream := sqldb.MigrationSet{
TrackingTableName: pgx.DefaultMigrationsTable,
SQLFileDirectory: "sqlc/migrations",
SQLFiles: SqlSchemas,
@ -50,7 +50,7 @@ func MakeTestMigrationStreams() []sqldb.MigrationStream {
},
}
migStreamDev := sqldb.MigrationStream{
migStreamDev := sqldb.MigrationSet{
TrackingTableName: pgx.DefaultMigrationsTable + "_dev",
SQLFileDirectory: "sqlc/migrations_dev",
SQLFiles: SqlSchemas,
@ -69,5 +69,5 @@ func MakeTestMigrationStreams() []sqldb.MigrationStream {
},
}
return []sqldb.MigrationStream{migStream, migStreamDev}
return []sqldb.MigrationSet{migStream, migStreamDev}
}

View file

@ -16,11 +16,11 @@ import (
// MakeMigrationStreams creates the migration streams for production
// environments.
func MakeMigrationStreams(_ context.Context, _ lnrpc.LightningClient, _ string,
_ clock.Clock) []sqldb.MigrationStream {
_ clock.Clock) []sqldb.MigrationSet {
// migStream defines the SQL migration stream used to create
// and upgrade LiT's SQL schema.
migStream := sqldb.MigrationStream{
migStream := sqldb.MigrationSet{
TrackingTableName: pgx.DefaultMigrationsTable,
SQLFileDirectory: "sqlc/migrations",
SQLFiles: db.SqlSchemas,
@ -39,5 +39,5 @@ func MakeMigrationStreams(_ context.Context, _ lnrpc.LightningClient, _ string,
},
}
return []sqldb.MigrationStream{migStream}
return []sqldb.MigrationSet{migStream}
}

View file

@ -26,10 +26,10 @@ const (
// MakeMigrationStreams creates the migration streams for the dev environments.
func MakeMigrationStreams(ctx context.Context,
basicClient lnrpc.LightningClient, macPath string,
clock clock.Clock) []sqldb.MigrationStream {
clock clock.Clock) []sqldb.MigrationSet {
// Create the prod migration stream.
migStream := sqldb.MigrationStream{
migStream := sqldb.MigrationSet{
TrackingTableName: pgx.DefaultMigrationsTable,
SQLFileDirectory: "sqlc/migrations",
SQLFiles: db.SqlSchemas,
@ -49,7 +49,7 @@ func MakeMigrationStreams(ctx context.Context,
}
// Create the dev migration stream.
migStreamDev := sqldb.MigrationStream{
migStreamDev := sqldb.MigrationSet{
TrackingTableName: pgx.DefaultMigrationsTable + "_dev",
SQLFileDirectory: "sqlc/migrations_dev",
SQLFiles: db.SqlSchemas,
@ -83,5 +83,5 @@ func MakeMigrationStreams(ctx context.Context,
},
}
return []sqldb.MigrationStream{migStream, migStreamDev}
return []sqldb.MigrationSet{migStream, migStreamDev}
}

8
go.mod
View file

@ -40,8 +40,7 @@ require (
github.com/lightningnetwork/lnd/fn v1.2.5
github.com/lightningnetwork/lnd/fn/v2 v2.0.9
github.com/lightningnetwork/lnd/kvdb v1.4.16
github.com/lightningnetwork/lnd/sqldb v1.0.12-0.20260113193010-8565d12e40b1
github.com/lightningnetwork/lnd/sqldb/v2 v2.0.0-00010101000000-000000000000
github.com/lightningnetwork/lnd/sqldb/v2 v2.0.0-20260326184657-f7cc56305bae
github.com/lightningnetwork/lnd/tlv v1.3.2
github.com/lightningnetwork/lnd/tor v1.1.6
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f
@ -155,6 +154,7 @@ require (
github.com/lightningnetwork/lightning-onion v1.2.1-0.20240815225420-8b40adf04ab9 // indirect
github.com/lightningnetwork/lnd/healthcheck v1.2.6 // indirect
github.com/lightningnetwork/lnd/queue v1.1.1 // indirect
github.com/lightningnetwork/lnd/sqldb v1.0.12-0.20260113193010-8565d12e40b1 // indirect
github.com/lightningnetwork/lnd/ticker v1.1.1 // indirect
github.com/ltcsuite/ltcd v0.0.0-20190101042124-f37f8bf35796 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
@ -258,7 +258,3 @@ replace github.com/golang-migrate/migrate/v4 => github.com/lightninglabs/migrate
// The upstream nhooyr.io/websocket repository has been moved to github.com/coder/websocket.
replace nhooyr.io/websocket => github.com/coder/websocket v1.8.7
// TODO: Remove these replace directives after the sqldb/v2 module is
// published.
replace github.com/lightningnetwork/lnd/sqldb/v2 => github.com/ViktorT-11/lnd/sqldb/v2 v2.0.0-20260123000653-a803b19d1e1e

4
go.sum
View file

@ -617,8 +617,6 @@ github.com/NebulousLabs/go-upnp v0.0.0-20180202185039-29b680b06c82/go.mod h1:Gbu
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw=
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/ViktorT-11/lnd/sqldb/v2 v2.0.0-20260123000653-a803b19d1e1e h1:wdKa4U6cRATtwbROOBMWS22CcRYAzz6ufylnOKVQYNI=
github.com/ViktorT-11/lnd/sqldb/v2 v2.0.0-20260123000653-a803b19d1e1e/go.mod h1:9B0I8PKvawQWL6Ul26vKDRDMnw1eoUigqM2y3teI7ds=
github.com/Yawning/aez v0.0.0-20211027044916-e49e68abd344 h1:cDVUiFo+npB0ZASqnw4q90ylaVAbnYyx0JYqK4YcGok=
github.com/Yawning/aez v0.0.0-20211027044916-e49e68abd344/go.mod h1:9pIqrY6SXNL8vjRQE5Hd/OL5GyK/9MrGUWs87z/eFfk=
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da h1:KjTM2ks9d14ZYCvmHS9iAKVt9AyzRSqNU1qabPih5BY=
@ -1184,6 +1182,8 @@ github.com/lightningnetwork/lnd/queue v1.1.1 h1:99ovBlpM9B0FRCGYJo6RSFDlt8/vOkQQ
github.com/lightningnetwork/lnd/queue v1.1.1/go.mod h1:7A6nC1Qrm32FHuhx/mi1cieAiBZo5O6l8IBIoQxvkz4=
github.com/lightningnetwork/lnd/sqldb v1.0.12-0.20260113193010-8565d12e40b1 h1:PkEppKL17cZh0Dr9h/T9BEVJUbd/p2tjJ/x8ffG3R0M=
github.com/lightningnetwork/lnd/sqldb v1.0.12-0.20260113193010-8565d12e40b1/go.mod h1:tB2jlqu79TIOR9uhAZOmPxpVFUhB2s+oxKnqRRL1oc0=
github.com/lightningnetwork/lnd/sqldb/v2 v2.0.0-20260326184657-f7cc56305bae h1:ICRuZIkXed43iuqcJaayubPTcQolttttwNZFrapdwIo=
github.com/lightningnetwork/lnd/sqldb/v2 v2.0.0-20260326184657-f7cc56305bae/go.mod h1:T2F1Sfb0oSpZyylIEE3ijiSejaXvIExER5xEdoe5wEE=
github.com/lightningnetwork/lnd/ticker v1.1.1 h1:J/b6N2hibFtC7JLV77ULQp++QLtCwT6ijJlbdiZFbSM=
github.com/lightningnetwork/lnd/ticker v1.1.1/go.mod h1:waPTRAAcwtu7Ji3+3k+u/xH5GHovTsCoSVpho0KDvdA=
github.com/lightningnetwork/lnd/tlv v1.3.2 h1:MO4FCk7F4k5xPMqVZF6Nb/kOpxlwPrUQpYjmyKny5s0=