Skip to content

Commit 6354999

Browse files
mutli: rename db.NewTestPostgresV2DB function
As the legacy `NewTestPostgresDB`` function is no longer used and has been removed, it no longer makes sense to have a `V2` suffix on the `NewTestPostgresV2DB` function. This commit renames it to `NewTestPostgresDB`, to indicate that this function now replaces the legacy function.
1 parent 0989cd6 commit 6354999

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

accounts/test_postgres.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ var ErrDBClosed = errors.New("database is closed")
1616

1717
// NewTestDB is a helper function that creates an SQLStore database for testing.
1818
func NewTestDB(t *testing.T, clock clock.Clock) Store {
19-
return createStore(t, db.NewTestPostgresV2DB(t).BaseDB, clock)
19+
return createStore(t, db.NewTestPostgresDB(t).BaseDB, clock)
2020
}
2121

2222
// NewTestDBFromPath is a helper function that creates a new SQLStore with a
2323
// connection to an existing postgres database for testing.
2424
func NewTestDBFromPath(t *testing.T, dbPath string,
2525
clock clock.Clock) Store {
2626

27-
return createStore(t, db.NewTestPostgresV2DB(t).BaseDB, clock)
27+
return createStore(t, db.NewTestPostgresDB(t).BaseDB, clock)
2828
}

db/postgres.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ func (s *PostgresConfig) DSN(hidePassword bool) string {
5656
s.DBName, sslMode)
5757
}
5858

59-
// NewTestPostgresV2DB is a helper function that creates a Postgres database for
60-
// testing, using the sqldb v2 package's definition of the PostgresStore.
61-
func NewTestPostgresV2DB(t *testing.T) *sqldb.PostgresStore {
59+
// NewTestPostgresDB is a helper function that creates a Postgres database for
60+
// testing.
61+
func NewTestPostgresDB(t *testing.T) *sqldb.PostgresStore {
6262
t.Helper()
6363

6464
t.Logf("Creating new Postgres DB for testing")

firewalldb/test_postgres.go

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

1212
// NewTestDB is a helper function that creates an BBolt database for testing.
1313
func NewTestDB(t *testing.T, clock clock.Clock) FirewallDBs {
14-
return createStore(t, db.NewTestPostgresV2DB(t).BaseDB, clock)
14+
return createStore(t, db.NewTestPostgresDB(t).BaseDB, clock)
1515
}
1616

1717
// NewTestDBFromPath is a helper function that creates a new BoltStore with a
1818
// connection to an existing BBolt database for testing.
1919
func NewTestDBFromPath(t *testing.T, _ string, clock clock.Clock) FirewallDBs {
20-
return createStore(t, db.NewTestPostgresV2DB(t).BaseDB, clock)
20+
return createStore(t, db.NewTestPostgresDB(t).BaseDB, clock)
2121
}

session/test_postgres.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ var ErrDBClosed = errors.New("database is closed")
1616

1717
// NewTestDB is a helper function that creates an SQLStore database for testing.
1818
func NewTestDB(t *testing.T, clock clock.Clock) Store {
19-
return createStore(t, db.NewTestPostgresV2DB(t).BaseDB, clock)
19+
return createStore(t, db.NewTestPostgresDB(t).BaseDB, clock)
2020
}
2121

2222
// NewTestDBFromPath is a helper function that creates a new SQLStore with a
2323
// connection to an existing postgres database for testing.
2424
func NewTestDBFromPath(t *testing.T, dbPath string,
2525
clock clock.Clock) Store {
2626

27-
return createStore(t, db.NewTestPostgresV2DB(t).BaseDB, clock)
27+
return createStore(t, db.NewTestPostgresDB(t).BaseDB, clock)
2828
}

0 commit comments

Comments
 (0)