testutils

package
v4.7.9 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupTestDB added in v4.1.5

func CleanupTestDB(db *sql.DB, tables ...string) error

CleanupTestDB cleans up test database tables

func SetupTestDB added in v4.1.5

func SetupTestDB(config TestDBConfig) (*sql.DB, error)

SetupTestDB sets up a test database connection

func TestEncryptionConfig added in v4.5.0

func TestEncryptionConfig(t *testing.T)

Types

type TestDBConfig added in v4.1.5

type TestDBConfig struct {
	Driver   string
	Host     string
	Port     int
	User     string
	Password string
	DBName   string
}

TestDBConfig represents database configuration for tests

func DefaultMySQLConfig added in v4.1.5

func DefaultMySQLConfig() TestDBConfig

DefaultMySQLConfig returns default MySQL configuration for tests

func DefaultPostgresConfig added in v4.1.5

func DefaultPostgresConfig() TestDBConfig

DefaultPostgresConfig returns default PostgreSQL configuration for tests

func (TestDBConfig) DSN added in v4.1.5

func (c TestDBConfig) DSN() string

DSN returns the data source name for the database

Jump to

Keyboard shortcuts

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