testdb

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: AGPL-3.0 Imports: 8 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 testdb gives each test its own freshly migrated Postgres database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exec

func Exec(t testing.TB, ownerURL, sql string, args ...any)

Exec runs SQL on the owner connection (for backdating rows in tests).

func New

func New(t testing.TB) (ownerURL, appURL string)

New creates database braid_test_<random> on BRAID_TEST_DATABASE_URL (a superuser URL), ensures the cluster roles exist, migrates as braid_owner and drops the database on cleanup.

func NewUnmigrated

func NewUnmigrated(t testing.TB) (ownerURL, appURL string)

NewUnmigrated is like New but leaves the database empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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