Help us shape the future of Go! Take the 2026 Go Developer Survey

testdb

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0, MIT Imports: 5 Imported by: 0

Documentation

Overview

Package testdb coordinates suites that share the Postgres service provided by the Dagger Test check.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotConfigured = errors.New(envVar + " is not set; run tests with `make test` so Dagger provisions Postgres")

ErrNotConfigured indicates that the suite is not running in Dagger's test environment.

Functions

This section is empty.

Types

type Suite

type Suite struct {
	// contains filtered or unexported fields
}

Suite holds the DSN and advisory lock for a DB-backed test suite.

func AcquireSuite

func AcquireSuite(ctx context.Context) (*Suite, error)

AcquireSuite resolves Dagger's Postgres DSN and serializes suites whose whole-table cleanup cannot safely overlap. Other test packages remain free to run in parallel.

func (*Suite) Close

func (s *Suite) Close(ctx context.Context) error

Close releases the advisory lock by closing its dedicated connection.

func (*Suite) DSN

func (s *Suite) DSN() string

DSN returns the connection string for the Dagger-provided Postgres service.

Jump to

Keyboard shortcuts

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