pgtest

package
v0.70.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package pgtest provides a shared test helper for spinning up a PostgreSQL container with migrations applied.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SetupResult

type SetupResult struct {
	Pool      *pgxpool.Pool
	ConnStr   string
	Container testcontainers.Container
}

SetupResult holds the resources from setting up a test database.

func Setup

func Setup(t *testing.T) *SetupResult

Setup creates a PostgreSQL container, runs migrations, and returns a connection pool. The container is automatically terminated when the test completes.

Jump to

Keyboard shortcuts

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