repository

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IN        = "IN"
	NotIN     = "NOT IN"
	BETWEEN   = "BETWEEN"
	LIKE      = "LIKE"
	IsNULL    = "IS NULL"
	IsNotNULL = "IS NOT NULL"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Delete

type Delete struct {
	Model  interface{}
	Wheres Wheres
}

type IBasicRepository

type IBasicRepository interface {
	IRepository
	ITxRepository
}

type IRepository

type IRepository interface {
	Get(*Query) error
	Find(*Query) error
	Create(interface{}) error
	CreateInTx(context.Context, interface{}) error
	Update(*Update) error
	UpdateInTx(context.Context, *Update) error
	UpdateColumn(*Update) error
	UpdateColumnInTx(context.Context, *Update) error
	Delete(*Delete) error
	DeleteInTx(context.Context, *Delete) error
}

type ITxRepository

type ITxRepository interface {
	Tx(context.Context, func(context.Context) error) error
	GetTx(context.Context) (interface{}, error)
}

type Paginate

type Paginate struct {
	Num, Size int
	Total     *int64
}

type Query

type Query struct {
	Model          interface{}
	Wheres         Wheres
	Recipient      interface{}
	OrderBy        string
	IgnoreNotFound bool
	Paginate       *Paginate
}

type TxKey

type TxKey struct{}

type Update

type Update struct {
	Model   interface{}
	Wheres  Wheres
	Update  interface{}
	Fields  map[string]interface{}
	SaveNil bool
	Omits   []string
}

type Where

type Where struct {
	Column    string
	Condition string
	V1        interface{}
	V2        interface{}
}

func Between

func Between(column string, v1, v2 interface{}) *Where

func Eq

func Eq(column string, value interface{}) *Where

func Gt

func Gt(column string, value interface{}) *Where

func Gte

func Gte(column string, value interface{}) *Where

func In

func In(column string, value interface{}) *Where

func IsNotNull

func IsNotNull(column string) *Where

func IsNull

func IsNull(column string) *Where

func Like

func Like(column string, value interface{}) *Where

func Lt

func Lt(column string, value interface{}) *Where

func Lte

func Lte(column string, value interface{}) *Where

func Ne

func Ne(column string, value interface{}) *Where

func NotIn

func NotIn(column string, value interface{}) *Where

func (*Where) Build

func (w *Where) Build() (string, []interface{})

type Wheres

type Wheres []*Where

func NewWheres

func NewWheres() Wheres

func (Wheres) Add

func (w Wheres) Add(wheres ...*Where) Wheres

Jump to

Keyboard shortcuts

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