database

package
v0.0.0-...-c11a323 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

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

func CreateTestSchema(ctx context.Context, t *testing.T) (schema string)

CreateTestSchema creates a new test schema in the database.

func DropTestSchema

func DropTestSchema(ctx context.Context, t *testing.T, schema string)

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

func NewTestConnectionPool(ctx context.Context, t *testing.T) *pgxpool.Pool

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL