test

package
v0.0.0-...-9db51f9 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTestDB

func CreateTestDB(t *testing.T, migrationsPath string) *pgx.Conn

nolint:contextcheck CreateTestDB spawns a new postgres container (if not spawned yet) Runs migrations on the main database (if not run yet) Creates a new database for the test and returns a connection to it The test database is dropped after the test

func Migrate

func Migrate(t *testing.T, databaseURL string, migrationsPath string)

func MustParsePGUUID

func MustParsePGUUID(src string) pgtype.UUID

func MustStartPostgresContainer

func MustStartPostgresContainer(t *testing.T, ctx context.Context) testcontainers.Container

func ParsePGUUID

func ParsePGUUID(src string) (pgtype.UUID, error)

func ParseUUID

func ParseUUID(src string) (dst [16]byte, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳