dbtest

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package dbtest gives tests a fresh, migrated PostgreSQL database.

Tests are skipped unless AMMONODE_TEST_DATABASE_URL points at a server where the user may create databases, e.g. the dev container:

AMMONODE_TEST_DATABASE_URL=postgres://ammonode:ammonode@127.0.0.1:5432/ammonode?sslmode=disable

Index

Constants

View Source
const EnvURL = "AMMONODE_TEST_DATABASE_URL"

EnvURL names the variable holding the admin connection string used by tests.

Variables

This section is empty.

Functions

func New

func New(t testing.TB) *pgxpool.Pool

New creates a uniquely named database, applies all migrations and drops it when the test ends.

Types

This section is empty.

Jump to

Keyboard shortcuts

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