stdpgxtestfx

package
v0.0.246 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package stdpgxtestfx provides stdpgxfx connection pools for tests, on a PostgreSQL server that is started for the tests, so they need no Docker Compose or other prior setup.

The server is shared by all tests of a `go test` run (see stdtestcontainer.Postgres). Every fx app still gets its own database, cloned from a template that the migrator prepared once per run, and all named pools (e.g. "rw" and "ro") connect to that one database. Only test code should import this package: it pulls in testcontainers-go and the Docker client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Provide

func Provide[DBT any](
	tb testing.TB,
	image string,
	mig pgtestdb.Migrator,
	drv stdpgxfx.Driver[DBT],
	mainPoolName string,
	derivedPoolNames ...string,
) fx.Option

Provide works like stdpgxfx.TestProvide, but connects to a PostgreSQL server that is started for the tests from image (e.g. "postgres:18"; see stdtestcontainer.Postgres), instead of the one in STDPGX_MAIN_DATABASE_URL, which it sets for the pools. To use a server of your own, call stdpgxfx.TestProvide instead and set that variable.

Types

This section is empty.

Jump to

Keyboard shortcuts

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