dbfixture

package module
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: BSD-2-Clause Imports: 16 Imported by: 34

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BeforeInsertData added in v1.0.9

type BeforeInsertData struct {
	Query *bun.InsertQuery
	Model interface{}
}

type BeforeInsertFunc added in v1.0.9

type BeforeInsertFunc func(ctx context.Context, data *BeforeInsertData) error

type Encoder added in v1.0.0

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

func NewEncoder added in v1.0.0

func NewEncoder(db bun.IDB, w io.Writer) *Encoder

func (*Encoder) Encode added in v1.0.0

func (e *Encoder) Encode(multiRows ...interface{}) error

type Fixture

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

func New

func New(db bun.IDB, opts ...FixtureOption) *Fixture

func (*Fixture) Load

func (f *Fixture) Load(ctx context.Context, fsys fs.FS, names ...string) error

func (*Fixture) MustRow

func (f *Fixture) MustRow(id string) interface{}

func (*Fixture) Row

func (f *Fixture) Row(id string) (interface{}, error)

type FixtureOption

type FixtureOption func(l *Fixture)

func WithBeforeInsert added in v1.0.9

func WithBeforeInsert(fn BeforeInsertFunc) FixtureOption

func WithRecreateTables

func WithRecreateTables() FixtureOption

func WithTemplateFuncs

func WithTemplateFuncs(funcMap template.FuncMap) FixtureOption

func WithTruncateTables

func WithTruncateTables() FixtureOption

Jump to

Keyboard shortcuts

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