dbtest

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

@index Test-only PostgreSQL helpers that give each test its own schema so postgres-tagged packages can run concurrently.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsolatedPostgresDSN

func IsolatedPostgresDSN(t *testing.T) string

IsolatedPostgresDSN returns a DSN whose schema only this test may write to. @intent let a test build its own tables without a concurrently running test seeing or dropping them. @sideEffect creates a schema on the server and drops it when the test finishes.

func OpenIsolatedPostgres

func OpenIsolatedPostgres(t *testing.T) *gorm.DB

OpenIsolatedPostgres opens a GORM connection scoped to this test's own schema. @intent replace the per-package "open postgres and wipe the shared schema" helper with one safe entry point.

func PostgresDSN

func PostgresDSN() string

PostgresDSN reports where postgres-tagged tests look for a database. @intent give every postgres-tagged package one shared answer for "which server" instead of a copy per package.

Types

This section is empty.

Jump to

Keyboard shortcuts

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