testdb

package
v0.0.0-...-89de701 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package testdb provides a shared PostgreSQL testcontainer with the shopmon schema applied. It is separate from testutil so packages that testutil itself depends on (e.g. internal/jobs) can run database-backed tests without an import cycle.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnString

func ConnString(t *testing.T) string

ConnString returns the connection string of the shared container, starting it on first use.

func Setup

func Setup(t *testing.T) *pgxpool.Pool

Setup returns a pool to the shared database with all tables truncated, so each test starts from a clean slate. The pool is closed on test cleanup.

func TruncateAll

func TruncateAll(t *testing.T, pool *pgxpool.Pool)

TruncateAll empties every table in the public schema.

Types

This section is empty.

Jump to

Keyboard shortcuts

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