Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PostgresContainer ¶
type PostgresContainer struct {
Container testcontainers.Container
Config *database.Config
DB *database.Connection
}
PostgresContainer wraps a testcontainers PostgreSQL instance
func SetupPostgresContainer ¶
SetupPostgresContainer creates and starts a PostgreSQL test container
func (*PostgresContainer) Cleanup ¶
func (c *PostgresContainer) Cleanup(ctx context.Context) error
Cleanup terminates the test container and closes database connection
func (*PostgresContainer) ResetDatabase ¶
func (c *PostgresContainer) ResetDatabase(ctx context.Context) error
ResetDatabase drops and recreates all tables (useful for clean state)
func (*PostgresContainer) TruncateTables ¶
func (c *PostgresContainer) TruncateTables(ctx context.Context, tables ...string) error
TruncateTables removes all data from tables (useful between tests)
Click to show internal directories.
Click to hide internal directories.