dbcontainer

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package dbcontainer is an internal helper for the test packages. This packages facilitates creation of a temporary postgres:16 podman container and connecting to it, using a *postgres.Pool connection pool. It may be used in all integration-level test suites which require a real PostgreSQL DBMS server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, timeout time.Duration, t *testing.T) (
	pg *sqltestutil.PostgresContainer,
	pool *postgres.Pool,
	dfrs []func(),
	ok bool,
)

New creates and starts up a postgres podman container. The podman.service needs to be started and the DOCKER_HOST environment variable needs to be initialized beforehand like DOCKER_HOST=unix://$XDG_RUNTIME_DIR/podman/podman.sock in order to be identified by this function properly. The ctx will be used during the container start up and shutdown, while the timeout will be considered only during the start up phase.

Types

This section is empty.

Jump to

Keyboard shortcuts

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