mymodel

package
v0.0.0-...-3cb96c0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(ctx context.Context, model interface{}, filter ...Filter) error

Types

type Cond

type Cond interface {
	Where(f func(b mystmt.Cond))
	Having(f func(b mystmt.Cond))
	OrderBy(col string) mystmt.OrderBy
	Limit(n int64)
	Offset(n int64)
}

type Filter

type Filter interface {
	Apply(ctx context.Context, b Cond) error
}

func Equal

func Equal(field string, value interface{}) Filter

func Having

func Having(f func(b mystmt.Cond)) Filter

func Limit

func Limit(n int64) Filter

func Offset

func Offset(n int64) Filter

func OrderBy

func OrderBy(col string) Filter

func Where

func Where(f func(b mystmt.Cond)) Filter

type FilterFunc

type FilterFunc func(ctx context.Context, b Cond) error

func (FilterFunc) Apply

func (f FilterFunc) Apply(ctx context.Context, b Cond) error

type Inserter

type Inserter interface {
	Insert(b mystmt.InsertStatement)
}

Inserter model

type Scanner

type Scanner interface {
	Scan(scan mysql.Scanner) error
}

Scanner model

type Selector

type Selector interface {
	Select(b mystmt.SelectStatement)
	Scanner
}

Selector model

type Updater

type Updater interface {
	Update(b mystmt.UpdateStatement)
}

Updater model

Jump to

Keyboard shortcuts

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