pkgerx

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SQLTemplateFuncs = map[string]interface{}{
	"identifier": Identifier,
}

Functions

func Identifier

func Identifier(i string) (string, error)

func MustRead

func MustRead(f pkging.File, err error) []byte

MustRead reads a pkging.File or panics.

func Read

func Read(f pkging.File, err error) ([]byte, error)

Read reads a pkging.File or returns an error

func WithMigrationContentMiddleware

func WithMigrationContentMiddleware(middleware func(content string, err error) (string, error)) func(*MigrationBox) *MigrationBox

func WithTemplateValues

func WithTemplateValues(v map[string]interface{}) func(*MigrationBox) *MigrationBox

Types

type MigrationBox

type MigrationBox struct {
	pop.Migrator

	Dir pkger.Dir
	// contains filtered or unexported fields
}

MigrationBox is a wrapper around pkger.Dir and Migrator. This will allow you to run migrations from migrations packed inside of a compiled binary.

func NewMigrationBox

func NewMigrationBox(dir pkger.Dir, c *pop.Connection, l *logrusx.Logger, opts ...func(*MigrationBox) *MigrationBox) (*MigrationBox, error)

NewMigrationBox from a packr.Dir and a Connection.

migrations, err := NewMigrationBox(pkger.Dir("/migrations"))

type MigrationContent

type MigrationContent func(mf pop.Migration, c *pop.Connection, r io.Reader, usingTemplate bool) (string, error)

Jump to

Keyboard shortcuts

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