Documentation
¶
Overview ¶
Package db opens the Postgres pool and runs schema migrations (goose for ReputeCast's own tables, rivermigrate for River's job tables).
Index ¶
- func HasPending(ctx context.Context, pool *pgxpool.Pool, logger *slog.Logger) (bool, error)
- func MigrateDown(ctx context.Context, pool *pgxpool.Pool, logger *slog.Logger) error
- func MigrateUp(ctx context.Context, pool *pgxpool.Pool, logger *slog.Logger) error
- func Open(ctx context.Context, url string, maxConns int32) (*pgxpool.Pool, error)
- func Tx(ctx context.Context, pool *pgxpool.Pool, fn func(pgx.Tx) error) (err error)
- type MigrationStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasPending ¶
HasPending reports whether any goose migration is not yet applied.
func MigrateDown ¶
MigrateDown rolls back the latest goose migration.
Types ¶
type MigrationStatus ¶
MigrationStatus describes one goose migration.
Click to show internal directories.
Click to hide internal directories.