migrationstats

package
v3.30.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileWalker

type FileWalker interface {
	// Walk invokes fn for each file.
	Walk(fn func(filename string, r io.Reader) error) error
}

FileWalker walks all files for GatherStats.

func NewFileWalker added in v3.17.0

func NewFileWalker(filenames ...string) FileWalker

NewFileWalker returns a new FileWalker for the given filenames.

Filenames without a .sql or .go extension are ignored.

type Stats

type Stats struct {
	// FileName is the name of the file.
	FileName string
	// Version is the version of the migration.
	Version int64
	// Tx is true if the .sql migration file has a +goose NO TRANSACTION annotation
	// or the .go migration file calls AddMigrationNoTx.
	Tx bool
	// UpCount is the number of statements in the Up migration.
	UpCount int
	// DownCount is the number of statements in the Down migration.
	DownCount int
}

Stats contains the stats for a migration file.

func GatherStats

func GatherStats(fw FileWalker, debug bool) ([]*Stats, error)

GatherStats returns the migration file stats.

Jump to

Keyboard shortcuts

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