testdb

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package testdb gives DB-backed tests a throwaway Postgres schema loaded with a synthetic fixture. Tests are skipped when AFC_TEST_DB is unset.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(t *testing.T) (*sqlx.DB, string)

Open creates a uniquely named schema in the AFC_TEST_DB database, loads schema.sql and seed.sql into it, and returns a connection plus a DSN whose search_path points at that schema. The schema is dropped when the test ends.

Types

This section is empty.

Jump to

Keyboard shortcuts

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