Documentation
¶
Index ¶
- func RequireDocker(t *testing.T)
- func StartNATSServer(t *testing.T) *server.Server
- type PostgresContainer
- func (tc *PostgresContainer) AddCleanup(fn func())
- func (tc *PostgresContainer) ApplyMigrations(migrationsPath string) error
- func (tc *PostgresContainer) ApplyMigrationsLegacy() error
- func (tc *PostgresContainer) Cleanup()
- func (tc *PostgresContainer) ExecuteSQL(sql string) error
- func (tc *PostgresContainer) TruncateAllTables() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RequireDocker ¶
RequireDocker skips the test if Docker is not available
Types ¶
type PostgresContainer ¶
type PostgresContainer struct {
Container *postgres.PostgresContainer
ConnectionStr string
DB *db.DB
UsingExistingDB bool
// contains filtered or unexported fields
}
PostgresContainer holds the testcontainer instance and connection details
func SetupTestDatabase ¶
func SetupTestDatabase(t *testing.T) *PostgresContainer
SetupTestDatabase creates a PostgreSQL testcontainer with TimescaleDB and pgvector
func (*PostgresContainer) AddCleanup ¶
func (tc *PostgresContainer) AddCleanup(fn func())
AddCleanup registers a cleanup function to be called during teardown
func (*PostgresContainer) ApplyMigrations ¶
func (tc *PostgresContainer) ApplyMigrations(migrationsPath string) error
ApplyMigrations runs SQL migrations from the migrations directory
func (*PostgresContainer) ApplyMigrationsLegacy ¶
func (tc *PostgresContainer) ApplyMigrationsLegacy() error
ApplyMigrationsLegacy provides a minimal schema if migration file is not available
func (*PostgresContainer) Cleanup ¶
func (tc *PostgresContainer) Cleanup()
Cleanup terminates the container and runs cleanup functions
func (*PostgresContainer) ExecuteSQL ¶
func (tc *PostgresContainer) ExecuteSQL(sql string) error
ExecuteSQL executes arbitrary SQL (useful for test setup)
func (*PostgresContainer) TruncateAllTables ¶
func (tc *PostgresContainer) TruncateAllTables() error
TruncateAllTables clears all data from tables (useful for test isolation)
Click to show internal directories.
Click to hide internal directories.