Skip to content

Commit 62dcd36

Browse files
committed
Switch test db to use TB interface
1 parent 97ee0de commit 62dcd36

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

pkg/testsupport/test_connection.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import (
1111

1212
type TestDb struct {
1313
DB *sql.DB
14-
t *testing.T
14+
t testing.TB
1515
testDbName string
1616
}
1717

18-
func NewTestDb(t *testing.T) *TestDb {
18+
func NewTestDb(t testing.TB) *TestDb {
1919
testDbName := fmt.Sprintf("starter_test_%d", rand.IntN(1_000_000))
2020
WithSuperDb(t, func(superDb *sql.DB) {
2121
_, err := superDb.Exec(fmt.Sprintf("create database %s template starter_test", testDbName))
@@ -79,7 +79,7 @@ func (tdb *TestDb) QueryOneMap(statement string, arguments ...any) map[string]an
7979
return results[0]
8080
}
8181

82-
func WithSuperDb(t *testing.T, action func(superDb *sql.DB)) {
82+
func WithSuperDb(t testing.TB, action func(superDb *sql.DB)) {
8383
superDb := dbsupport.CreateConnection("postgres://super_test@localhost:5432/postgres?sslmode=disable")
8484
defer func(superDb *sql.DB) {
8585
err := superDb.Close()

0 commit comments

Comments
 (0)