1
0
mirror of https://github.com/xorcare/testing-go-code-with-postgres.git synced 2025-06-30 23:23:40 +02:00

Migrate to sql.DB driver

This is to reduce dependency on a particular driver. In the future this
will be used to implement different ways of cleaning the database.
This commit is contained in:
Vasiliy Vasilyuk
2024-02-17 16:38:16 +03:00
parent 883c9e0805
commit 912e9c9ab0
5 changed files with 30 additions and 32 deletions

View File

@ -1,4 +1,4 @@
// Copyright (c) 2023 Vasiliy Vasilyuk. All rights reserved.
// Copyright (c) 2023-2024 Vasiliy Vasilyuk. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@ -36,7 +36,7 @@ func TestUserRepository_CreateUser(t *testing.T) {
// Arrange
postgres := testingpg.New(t)
repo := rootpkg.NewUserRepository(postgres.PgxPool())
repo := rootpkg.NewUserRepository(postgres.DB())
user := newFullyFiledUser()
@ -57,7 +57,7 @@ func TestUserRepository_CreateUser(t *testing.T) {
// Arrange
postgres := testingpg.New(t)
repo := rootpkg.NewUserRepository(postgres.PgxPool())
repo := rootpkg.NewUserRepository(postgres.DB())
user := newFullyFiledUser()
@ -85,7 +85,7 @@ func TestUserRepository_ReadUser(t *testing.T) {
// Arrange
postgres := testingpg.New(t)
repo := rootpkg.NewUserRepository(postgres.PgxPool())
repo := rootpkg.NewUserRepository(postgres.DB())
// Act
_, err := repo.ReadUser(context.Background(), uuid.New())