provider

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package provider provides an iterator for iterating over all of the migration statements that need to be applied. It will provide the statements in the correct order based on the Edition priority and migration version.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseState

type DatabaseState map[string]int

DatabaseState is a map of edition names to versions.

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider provides the migrations to the schema.Manager in the correct order.

func New

func New(dbState DatabaseState, editions edition.Editions) *Provider

New creates a Provider. The given DatabaseState is compared against the editions to determine which migrations need to be applied and the migrations are then ordered based on the Edition priority and by the migration version.

func (*Provider) Edition

func (p *Provider) Edition() string

Edition returns the edition name for the current migration.

func (*Provider) Next

func (p *Provider) Next() bool

Next proceeds to the next migration. It returns true on success or false if there are no more migrations.

func (*Provider) Statements

func (p *Provider) Statements() []byte

Statements returns the sql statements name for the current migration.

func (*Provider) Version

func (p *Provider) Version() int

Version returns the version for the current migration.

Jump to

Keyboard shortcuts

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