pgtest

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package pgtest starts a throwaway PostgreSQL container for tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(ctx context.Context, schema string) (*pgxpool.Pool, func(), error)

Start runs a postgres container, applies schema, and returns a pool and a stop function. It is meant for TestMain, so one container serves the package.

func Unique

func Unique(t testing.TB, s string) string

Unique returns s made unique to this call: it embeds the test name and a process-wide counter. Tests share one database for the whole package run, so fixed names and keys would collide under -count=N or when tests are reordered.

Types

This section is empty.

Jump to

Keyboard shortcuts

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