Documentation ¶ Overview ¶ Package dbtest contains supporting code for running tests that hit the DB. Index ¶ func NewUnit(t *testing.T, options ...Option) (*slog.Logger, *pgxpool.Pool, func()) type Option func WithMigrations() Option 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 Source Files ¶ View all Source files dbtest.go Click to show internal directories. Click to hide internal directories.