postgres

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cleanup

func Cleanup() error

Cleanup purges the shared container

Types

type ConnectionInfo

type ConnectionInfo struct {
	Host     string
	Port     string
	User     string
	Password string
	DBName   string
	SSLMode  string
}

ConnectionInfo contains database connection details

func (ConnectionInfo) ConnectionString

func (c ConnectionInfo) ConnectionString() string

ConnectionString returns a PostgreSQL connection string

type Options

type Options struct {
	// MigrationsDir is the path to the migrations directory
	MigrationsDir string
}

Options configures the test database creation

type TestDB

type TestDB struct {
	DB       *sqlx.DB
	ConnInfo ConnectionInfo
	// contains filtered or unexported fields
}

TestDB represents a test database instance

func NewTestDB

func NewTestDB(opts Options) (*TestDB, error)

NewTestDB creates a new isolated test database with migrations applied

func (*TestDB) Close

func (t *TestDB) Close() error

Close cleans up the test database

Jump to

Keyboard shortcuts

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