testpg

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 9 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 testpg gives integration tests the DSNs of the Docker fixture and throwaway databases. Its helpers fail the test, never skip it, when the fixture is not running.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Admin

func Admin(t testing.TB) string

Admin returns the DSN of the superuser postgres.

func Bouncer

func Bouncer(t testing.TB) string

Bouncer returns the DSN of role pgdba_ro through PgBouncer in transaction mode.

func DSN

func DSN(base, dbname string) string

DSN returns base with its database replaced by dbname.

func RO

func RO(t testing.TB) string

RO returns the DSN of role pgdba_ro.

func RW

func RW(t testing.TB) string

RW returns the DSN of role pgdba_rw.

func TempDB

func TempDB(t testing.TB) string

TempDB creates an empty database with a unique name as postgres, lets pgdba_ro and pgdba_rw connect to it, drops it when the test ends, and returns its name.

Types

This section is empty.

Jump to

Keyboard shortcuts

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