testpg

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package testpg creates isolated PostgreSQL schemas for integration tests. It never substitutes an in-memory database for PostgreSQL behavior.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	DB     *pgkit.DB
	Schema string
}

func Open

func Open(t testing.TB) Database

func OpenWithMaxConns

func OpenWithMaxConns(t testing.TB, maxConns int32) Database

OpenWithMaxConns creates an isolated real-PostgreSQL test database whose application pool has the requested capacity. Small pools are useful for proving that Flow releases its connection before invoking application code.

func OpenWithQueryTracer added in v0.3.0

func OpenWithQueryTracer(t testing.TB, tracer pgx.QueryTracer) Database

OpenWithQueryTracer creates an isolated database whose application connections report SQL through tracer. It is intended for query-shape and query-count regression tests.

Jump to

Keyboard shortcuts

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