testutil

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

internal/testutil/db.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestDB

type TestDB struct {
	DB        *sqlx.DB
	Container testcontainers.Container
	ConnStr   string
}

TestDB holds the test database connection and container

func SetupTestDB

func SetupTestDB(t *testing.T) *TestDB

SetupTestDB initializes a PostgreSQL container and returns a connected DB

func (*TestDB) Teardown

func (td *TestDB) Teardown(t *testing.T)

Teardown cleans up the test database and container

Jump to

Keyboard shortcuts

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