dbtest

package
v0.0.0-...-54e2a34 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Overview

Package dbtest contains supporting code for running tests that hit the DB.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUnit

func NewUnit(t *testing.T, options ...Option) (*slog.Logger, *pgxpool.Pool, func())

NewUnit creates a test database inside a Docker container. It gives options to migrate and seed the database. It returns the database to use as well as a function to call at the end of the test.

Types

type Option

type Option func(context.Context, *testing.T, *pgxpool.Pool, *dbContainer) error

func WithMigrations

func WithMigrations() Option

Jump to

Keyboard shortcuts

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