dbtest

package
v0.1.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package dbtest provides Postgres-backed integration-test helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyDown

func ApplyDown(t *testing.T, sqlDB *sql.DB)

func ApplyUp

func ApplyUp(t *testing.T, sqlDB *sql.DB)

func MigrationFiles

func MigrationFiles(t *testing.T, pattern string, reverse bool) []string

func RequireCount

func RequireCount(t *testing.T, sqlDB *sql.DB, query string, want int, args ...any)

func RuntimeDSN

func RuntimeDSN(t *testing.T, sqlDB *sql.DB, superDSN string) string

func SeedSecondTenant

func SeedSecondTenant(t *testing.T, sqlDB *sql.DB, slug string) uuid.UUID

func SeedSigningKey

func SeedSigningKey(t *testing.T, sqlDB *sql.DB, tenantID uuid.UUID)

func SeedTenant

func SeedTenant(t *testing.T, sqlDB *sql.DB, slug string) uuid.UUID

func TenantProjectSQL

func TenantProjectSQL(tenantID uuid.UUID, slug string) string

func TestMasterKey

func TestMasterKey() []byte

Types

type Harness

type Harness struct {
	DSN      string
	SQL      *sql.DB
	Gorm     *gorm.DB
	TenantDB *db.TenantScopedDB
}

func New

func New(t *testing.T) *Harness

Jump to

Keyboard shortcuts

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