pgtest

package
v0.0.0-...-6451a0a Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package pgtest gives Postgres repository tests a database. One container serves a test binary, and each test gets its own schema: isolation without a container per test or truncating.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DSN

func DSN(t *testing.T) string

DSN starts the container on first use, one per test package. The testcontainers reaper removes it when the test binary exits.

func Open

func Open(t *testing.T, dsn string) *sql.DB

Open creates an empty schema and returns a pool whose search_path is that schema alone. The schema is dropped when the test finishes, so tests can run in parallel.

Types

This section is empty.

Jump to

Keyboard shortcuts

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