pkgerx

package
v0.0.631 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func Identifier added in v0.0.179

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 added in v0.0.179

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

func WithTemplateValues added in v0.0.179

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

Types

type MigrationBox added in v0.0.165

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 added in v0.0.165

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 added in v0.0.179

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