db

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package db provides embedded database migrations for pbflags. Migrations are managed by goose and applied automatically via --upgrade.

Index

Constants

View Source
const MinSchemaVersion = 1

MinSchemaVersion is the minimum migration version required by this binary.

Variables

This section is empty.

Functions

func CheckSchemaVersion added in v0.11.0

func CheckSchemaVersion(ctx context.Context, dsn string) error

CheckSchemaVersion verifies the database schema meets the minimum required migration version. Returns an error with an actionable message if the schema is missing or behind.

func CheckSchemaVersionConn added in v0.11.0

func CheckSchemaVersionConn(ctx context.Context, conn *sql.DB) error

CheckSchemaVersionConn is like CheckSchemaVersion but accepts an existing *sql.DB connection.

func Migrate

func Migrate(ctx context.Context, dsn string) error

Migrate runs all pending goose migrations against the given PostgreSQL DSN.

Types

This section is empty.

Jump to

Keyboard shortcuts

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