Documentation
¶
Overview ¶
Package database provides functions to migrate the database.
Index ¶
- func GetMigrate(connString string) (*migrate.Migrate, error)
- func GetVersion(connString string) (uint, bool, error)
- func MigrateDown(_ context.Context, db *pgx.Conn, steps int) error
- func MigrateUp(_ context.Context, db *pgx.Conn) error
- func SetupTestDB(t *testing.T) (*pgx.Conn, func())
- func SetupTestDBContaienr(t *testing.T, ctx context.Context) (*pgx.Conn, func())
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMigrate ¶
GetMigrate creates a new migrate instance using the embedded migrations
func GetVersion ¶
GetVersion returns the current migration version
func MigrateDown ¶
MigrateDown reverts the last migration
func SetupTestDB ¶
SetupTestDB creates a Postgres container using testcontainers and runs all migrations
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.