testdb

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package testdb provides fresh PostgreSQL test databases on the server GOPHENBERG_TEST_DATABASE_URL names.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsServer added in v0.20.0

func AsServer(t testing.TB, address string) string

AsServer returns address connecting as the role the test server itself is reached as.

func Migrator

func Migrator() pgtestdb.Migrator

Migrator returns a pgtestdb migrator that applies the authkit migrations and then the core ones.

func New added in v0.19.0

func New(t testing.TB, migrator pgtestdb.Migrator) string

New returns the address of a fresh database that migrator builds on the test server, after a sweep of stale ones.

func Open added in v0.20.0

func Open(t testing.TB, address string) *sql.DB

Open returns the database/sql view of a capped handle on the database at address, closed when t ends.

func Server added in v0.20.0

func Server(t testing.TB) string

Server returns the address of the test server itself, as GOPHENBERG_TEST_DATABASE_URL names it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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