graph/db: freeze sql migration queries

This commit is contained in:
Elle Mouton authored and yyforyongyu committed 2025-11-12 22:54:06 +08:00
1 parent 5db82a4233
commit 352b4d620a
11 files changed
+4141 -17

No files matched your search

+6 -7
View File
@@ -3,10 +3,10 @@
package migration1
import (
"database/sql"
"testing"
"github.com/btcsuite/btcd/chaincfg"
"github.com/lightningnetwork/lnd/graph/db/migration1/sqlc"
"github.com/lightningnetwork/lnd/sqldb"
"github.com/stretchr/testify/require"
)
@@ -69,11 +69,10 @@ func newBatchQuerier(t testing.TB) BatchedSQLQueries {
func newBatchQuerierWithFixture(t testing.TB,
pgFixture *sqldb.TestPgFixture) BatchedSQLQueries {
db := sqldb.NewTestPostgresDB(t, pgFixture).BaseDB
rawDB := sqldb.NewTestPostgresDB(t, pgFixture).BaseDB.DB
return sqldb.NewTransactionExecutor(
db, func(tx *sql.Tx) SQLQueries {
return db.WithTx(tx)
},
)
return &testBatchedSQLQueries{
db: rawDB,
Queries: sqlc.New(rawDB),
}
}