withdb

package
v0.0.0-...-1c0f521 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

withdb is a simplified way of creating test databases, used to test the internal packages that pgtestdb depends on.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithDB

func WithDB(ctx context.Context, driverName string, cb func(*sql.DB) error) (final error)

WithDB is a helper for writing postgres-backed tests. It will: - connect to a local postgres server (see docker-compose.yml) - create a new, empty test database with a unique name - open a connection to that test database - run the `cb` function - remove the test database

This is designed to be an internal helper for testing other database-related packages, and should not be relied upon externally.

Types

This section is empty.

Jump to

Keyboard shortcuts

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