pgtest

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPostgres

func NewPostgres(t *testing.T, opts ...Option) *drel.Engine

NewPostgres starts a Postgres container and returns a connected drel Engine. The container is torn down when the test completes via t.Cleanup.

Types

type Option

type Option func(*config)

Option configures NewPostgres.

func WithMigrations

func WithMigrations(dir string) Option

WithMigrations runs all pending migrations from dir after the container starts.

func WithSeed

func WithSeed(fn func(*drel.Engine)) Option

WithSeed runs a seed function against the engine after the container starts (and after any migrations if WithMigrations is also provided).

Jump to

Keyboard shortcuts

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