Documentation ¶
Index ¶
- func ApplyMigrations(t *testing.T, cfg *config.PostgresConfig)
- func CreateTestSchema(ctx context.Context, t *testing.T) (schema string)
- func DropTestSchema(ctx context.Context, t *testing.T, schema string)
- func GetTestConnectionPool(ctx context.Context, t *testing.T, cfg *config.PostgresConfig) *pgxpool.Pool
- func NewTestConnectionPool(ctx context.Context, t *testing.T) *pgxpool.Pool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyMigrations ¶
func ApplyMigrations(t *testing.T, cfg *config.PostgresConfig)
ApplyMigrations applies the migrations to the test database.
func CreateTestSchema ¶
CreateTestSchema creates a new test schema in the database.
func DropTestSchema ¶
DropTestSchema drops the test schema from the database.
func GetTestConnectionPool ¶
func GetTestConnectionPool(ctx context.Context, t *testing.T, cfg *config.PostgresConfig) *pgxpool.Pool
GetTestConnectionPool creates a new connection pool to the test database.
func NewTestConnectionPool ¶
NewTestConnectionPool creates a new test schema, applies migrations and returns a connection pool to the test database. This function also automatically registers a cleanup function to drop the test schema after the test has run.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.