pgtest

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package pgtest runs a test body against a real PostgreSQL server.

Index

Constants

View Source
const (
	// Image is the server the suite runs against.
	Image = "postgres:17-alpine"

	// DriverName is the database/sql driver. pgx rather than lib/pq because it
	// is what platform-go uses, and because a generated package's claim is that
	// it works through database/sql whichever driver is underneath.
	DriverName = "pgx"
)

Variables

This section is empty.

Functions

func Run

func Run(tb testing.TB, fn func(ctx context.Context, db *sql.DB))

Run starts a Postgres container, opens a pool against it, and hands the pool to fn. It skips when containers were not asked for.

Types

This section is empty.

Jump to

Keyboard shortcuts

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