postgrestest

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DockerAvailable

func DockerAvailable() bool

DockerAvailable reports whether the Docker daemon is reachable.

func OpenDSN

func OpenDSN(t *testing.T, database string) (string, func())

OpenDSN returns a migrated Postgres DSN for integration tests. Prefer SharedDSN when multiple tests in one package need Postgres.

func SharedDB

func SharedDB(t *testing.T) *postgres.DB

SharedDB opens a connection to the shared migrated Postgres instance.

func SharedDSN

func SharedDSN(t *testing.T) string

SharedDSN returns a migrated Postgres DSN reused across tests in one process.

func TerminateShared

func TerminateShared()

TerminateShared stops the shared testcontainer started by SharedDSN.

Types

This section is empty.

Jump to

Keyboard shortcuts

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