testpg

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Overview

Package testpg starts a throwaway PostgreSQL for integration tests. Each test package calls Start once from TestMain and shares the database, so tests that use it must not call t.Parallel().

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	Pool *pgxpool.Pool
	DSN  string
	// contains filtered or unexported fields
}

DB is a migrated Postgres 17 running in a container.

func Start

func Start(ctx context.Context) (*DB, error)

Start runs the container, connects and applies the migrations.

func (*DB) Close

func (db *DB) Close()

Close disconnects and removes the container.

func (*DB) Reset

func (db *DB) Reset(ctx context.Context) error

Reset empties all Tasklane tables and restarts job IDs at 1.

Jump to

Keyboard shortcuts

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