testdb

package
v0.79.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package testdb owns AuthKit's Postgres integration-test harness.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyMigrations

func ApplyMigrations(t testing.TB, ctx context.Context, dbURL string)

ApplyMigrations applies AuthKit's embedded Postgres migrations to dbURL.

Types

type Postgres

type Postgres struct {
	Pool     *pgxpool.Pool
	URL      string
	Database string
}

Postgres is an isolated migrated database for integration tests.

func ScratchPostgres

func ScratchPostgres(t testing.TB) *Postgres

ScratchPostgres creates, migrates, and cleans up a scratch database on the server named by QUERY_TEST_DATABASE_URL, AUTHKIT_TEST_DATABASE_URL, or SQLC_DATABASE_URL. It skips when no URL is provided so ordinary go test runs do not start integration infrastructure by accident.

Jump to

Keyboard shortcuts

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