claw

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MigrateResult

type MigrateResult struct {
	Applied []string
	Skipped []string
}

MigrateResult summarises the outcome of a Migrate call.

func Migrate

func Migrate(ctx context.Context, cfg *config.Config, fromVersion, toVersion string) (MigrateResult, error)

Migrate applies all pending claw schema migrations in order. fromVersion and toVersion constrain which migrations to run:

  • fromVersion: skip migrations whose name is lexicographically <= fromVersion. An empty string means "start from the beginning".
  • toVersion: stop after applying the migration whose name is <= toVersion. An empty string (default) means "apply everything available".

Progress is printed to stdout as each migration runs.

type MigrationEntry

type MigrationEntry struct {
	// Name is the base filename of the migration (e.g. "001_init.sql").
	Name string
	// Applied is true when the migration is recorded in np_claw.schema_versions.
	Applied bool
}

MigrationEntry describes a single claw schema migration.

func Status

func Status(ctx context.Context, cfg *config.Config) ([]MigrationEntry, error)

Status returns the list of all known claw migrations with their applied state.

Jump to

Keyboard shortcuts

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