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.
This commit is contained in:
Viktor Torstensson 2025-07-24 01:47:28 +02:00
parent 03f4261714
commit eb26c2b1c5
No known key found for this signature in database
GPG key ID: 961CC8259AE675D4
4 changed files with 9 additions and 9 deletions

View file

@ -16,7 +16,7 @@ var ErrDBClosed = errors.New("database is closed")
// NewTestDB is a helper function that creates an SQLStore database for testing.
func NewTestDB(t *testing.T, clock clock.Clock) Store {
return createStore(t, db.NewTestPostgresV2DB(t).BaseDB, clock)
return createStore(t, db.NewTestPostgresDB(t).BaseDB, clock)
}
// NewTestDBFromPath is a helper function that creates a new SQLStore with a
@ -24,5 +24,5 @@ func NewTestDB(t *testing.T, clock clock.Clock) Store {
func NewTestDBFromPath(t *testing.T, dbPath string,
clock clock.Clock) Store {
return createStore(t, db.NewTestPostgresV2DB(t).BaseDB, clock)
return createStore(t, db.NewTestPostgresDB(t).BaseDB, clock)
}

View file

@ -56,9 +56,9 @@ func (s *PostgresConfig) DSN(hidePassword bool) string {
s.DBName, sslMode)
}
// NewTestPostgresV2DB is a helper function that creates a Postgres database for
// testing, using the sqldb v2 package's definition of the PostgresStore.
func NewTestPostgresV2DB(t *testing.T) *sqldb.PostgresStore {
// NewTestPostgresDB is a helper function that creates a Postgres database for
// testing.
func NewTestPostgresDB(t *testing.T) *sqldb.PostgresStore {
t.Helper()
t.Logf("Creating new Postgres DB for testing")

View file

@ -14,11 +14,11 @@ var isSqlite = false
// NewTestDB is a helper function that creates an BBolt database for testing.
func NewTestDB(t *testing.T, clock clock.Clock) FirewallDBs {
return createStore(t, db.NewTestPostgresV2DB(t).BaseDB, clock)
return createStore(t, db.NewTestPostgresDB(t).BaseDB, clock)
}
// NewTestDBFromPath is a helper function that creates a new BoltStore with a
// connection to an existing BBolt database for testing.
func NewTestDBFromPath(t *testing.T, _ string, clock clock.Clock) FirewallDBs {
return createStore(t, db.NewTestPostgresV2DB(t).BaseDB, clock)
return createStore(t, db.NewTestPostgresDB(t).BaseDB, clock)
}

View file

@ -16,7 +16,7 @@ var ErrDBClosed = errors.New("database is closed")
// NewTestDB is a helper function that creates an SQLStore database for testing.
func NewTestDB(t *testing.T, clock clock.Clock) Store {
return createStore(t, db.NewTestPostgresV2DB(t).BaseDB, clock)
return createStore(t, db.NewTestPostgresDB(t).BaseDB, clock)
}
// NewTestDBFromPath is a helper function that creates a new SQLStore with a
@ -24,5 +24,5 @@ func NewTestDB(t *testing.T, clock clock.Clock) Store {
func NewTestDBFromPath(t *testing.T, dbPath string,
clock clock.Clock) Store {
return createStore(t, db.NewTestPostgresV2DB(t).BaseDB, clock)
return createStore(t, db.NewTestPostgresDB(t).BaseDB, clock)
}