Documentation ¶
Index ¶
- Variables
- func Camel2UnderScore(name string) string
- func EnsureIsSliceOrArray(obj interface{}) (res reflect.Value)
- func EscapeMysqlString(sql string) string
- func Expr(expression string, args ...interface{}) map[string]any
- func FormatSql(sql string, values ...interface{}) string
- func IsUniqueIndexConflictErr(err error) bool
- func UniqueSlice(s interface{}) interface{}
- func UpdateCase[M string | *Cond](caseMap map[M]any, def ...interface{}) clause.Expr
- func UpdateCaseOneField(field string, caseMap map[any]any, def ...interface{}) clause.Expr
- type ChunkResult
- type Client
- type Cond
- type Config
- type CreateInBatchesResult
- type CreateNotExistResult
- type CreateOrUpdateResult
- type CreateResult
- type DeleteResult
- type Field
- type FindResult
- type FirstOrCreateResult
- type FirstResult
- type ListOption
- func (p *ListOption) AddOption(key uint8, value string) *ListOption
- func (p *ListOption) AddOptions(options ...*Options) *ListOption
- func (p *ListOption) Clone() *ListOption
- func (p *ListOption) Page() *Page
- func (p *ListOption) Processor() *ListOptionProcessor
- func (p *ListOption) SetLimit(limit uint64) *ListOption
- func (p *ListOption) SetOffset(offset uint64) *ListOption
- func (p *ListOption) SetOptions(options ...*Options) *ListOption
- func (p *ListOption) SetShowTotal(showTotal ...bool) *ListOption
- type ListOptionProcessor
- func (p *ListOptionProcessor) BetweenTimestamp(key uint8, logic func(start, end int64) error) *ListOptionProcessor
- func (p *ListOptionProcessor) Bool(key uint8, logic func(value bool) error) *ListOptionProcessor
- func (p *ListOptionProcessor) BoolSlice(key uint8, logic func(value []bool) error) *ListOptionProcessor
- func (p *ListOptionProcessor) Float32(key uint8, logic func(value float32) error) *ListOptionProcessor
- func (p *ListOptionProcessor) Float32Slice(key uint8, logic func(value []float32) error) *ListOptionProcessor
- func (p *ListOptionProcessor) Float64(key uint8, logic func(value float64) error) *ListOptionProcessor
- func (p *ListOptionProcessor) Float64Slice(key uint8, logic func(value []float64) error) *ListOptionProcessor
- func (p *ListOptionProcessor) Has(key uint8, logic func() error) *ListOptionProcessor
- func (p *ListOptionProcessor) Int(key uint8, logic func(value int) error) *ListOptionProcessor
- func (p *ListOptionProcessor) Int16(key uint8, logic func(value int16) error) *ListOptionProcessor
- func (p *ListOptionProcessor) Int16Slice(key uint8, logic func(value []int16) error) *ListOptionProcessor
- func (p *ListOptionProcessor) Int32(key uint8, logic func(value int32) error) *ListOptionProcessor
- func (p *ListOptionProcessor) Int32Slice(key uint8, logic func(value []int32) error) *ListOptionProcessor
- func (p *ListOptionProcessor) Int64(key uint8, logic func(value int64) error) *ListOptionProcessor
- func (p *ListOptionProcessor) Int64Slice(key uint8, logic func(value []int64) error) *ListOptionProcessor
- func (p *ListOptionProcessor) Int8(key uint8, logic func(value int8) error) *ListOptionProcessor
- func (p *ListOptionProcessor) Int8Slice(key uint8, logic func(value []int8) error) *ListOptionProcessor
- func (p *ListOptionProcessor) IntSlice(key uint8, logic func(value []int) error) *ListOptionProcessor
- func (p *ListOptionProcessor) Order(key uint8, logic func(value string) error) *ListOptionProcessor
- func (p *ListOptionProcessor) Process(tx *Scoop, values any) (*Page, error)
- func (p *ListOptionProcessor) String(key uint8, logic func(value string) error) *ListOptionProcessor
- func (p *ListOptionProcessor) StringSlice(key uint8, logic func(value []string) error) *ListOptionProcessor
- func (p *ListOptionProcessor) Timestamp(key uint8, logic func(value int64) error) *ListOptionProcessor
- func (p *ListOptionProcessor) TimestampRange(key uint8, logic func(start, end int64) error) *ListOptionProcessor
- func (p *ListOptionProcessor) Uint(key uint8, logic func(value uint) error) *ListOptionProcessor
- func (p *ListOptionProcessor) Uint16(key uint8, logic func(value uint16) error) *ListOptionProcessor
- func (p *ListOptionProcessor) Uint16Slice(key uint8, logic func(value []uint16) error) *ListOptionProcessor
- func (p *ListOptionProcessor) Uint32(key uint8, logic func(value uint32) error) *ListOptionProcessor
- func (p *ListOptionProcessor) Uint32Slice(key uint8, logic func(value []uint32) error) *ListOptionProcessor
- func (p *ListOptionProcessor) Uint64(key uint8, logic func(value uint64) error) *ListOptionProcessor
- func (p *ListOptionProcessor) Uint64Slice(key uint8, logic func(value []uint64) error) *ListOptionProcessor
- func (p *ListOptionProcessor) Uint8(key uint8, logic func(value uint8) error) *ListOptionProcessor
- func (p *ListOptionProcessor) Uint8Slice(key uint8, logic func(value []uint8) error) *ListOptionProcessor
- func (p *ListOptionProcessor) UintSlice(key uint8, logic func(value []uint) error) *ListOptionProcessor
- type Logger
- func (l *Logger) Error(ctx context.Context, s string, i ...interface{})
- func (l *Logger) Info(ctx context.Context, s string, i ...interface{})
- func (l *Logger) Log(skip int, begin time.Time, fc func() (sql string, rowsAffected int64), ...)
- func (l *Logger) LogMode(logLevel logger.LogLevel) logger.Interface
- func (l *Logger) Trace(ctx context.Context, begin time.Time, ...)
- func (l *Logger) Warn(ctx context.Context, s string, i ...interface{})
- type Model
- type ModelScoop
- func (p *ModelScoop[M]) Between(column string, min, max interface{}) *ModelScoop[M]
- func (p *ModelScoop[M]) Chunk(size uint64, fc func(tx *Scoop, out []*M, offset uint64) error) *ChunkResult
- func (p *ModelScoop[M]) Create(m *M) error
- func (p *ModelScoop[M]) CreateInBatches(value []*M, batchSize int) *CreateInBatchesResult
- func (p *ModelScoop[M]) CreateNotExist(m *M) *CreateNotExistResult[M]
- func (p *ModelScoop[M]) CreateOrUpdate(values map[string]interface{}, m *M) *CreateOrUpdateResult[M]
- func (p *ModelScoop[M]) Equal(column string, value interface{}) *ModelScoop[M]
- func (p *ModelScoop[M]) Find() ([]*M, error)
- func (p *ModelScoop[M]) First() (*M, error)
- func (p *ModelScoop[M]) FirstOrCreate(m *M) *FirstOrCreateResult[M]
- func (p *ModelScoop[M]) Group(fields ...string) *ModelScoop[M]
- func (p *ModelScoop[M]) Ignore(b ...bool) *ModelScoop[M]
- func (p *ModelScoop[M]) In(column string, values interface{}) *ModelScoop[M]
- func (p *ModelScoop[M]) LeftLike(column string, value string) *ModelScoop[M]
- func (p *ModelScoop[M]) Like(column string, value string) *ModelScoop[M]
- func (p *ModelScoop[M]) Limit(limit uint64) *ModelScoop[M]
- func (p *ModelScoop[M]) NotBetween(column string, min, max interface{}) *ModelScoop[M]
- func (p *ModelScoop[M]) NotEqual(column string, value interface{}) *ModelScoop[M]
- func (p *ModelScoop[M]) NotIn(column string, values interface{}) *ModelScoop[M]
- func (p *ModelScoop[M]) NotLeftLike(column string, value string) *ModelScoop[M]
- func (p *ModelScoop[M]) NotLike(column string, value string) *ModelScoop[M]
- func (p *ModelScoop[M]) NotRightLike(column string, value string) *ModelScoop[M]
- func (p *ModelScoop[M]) Offset(offset uint64) *ModelScoop[M]
- func (p *ModelScoop[M]) Order(fields ...string) *ModelScoop[M]
- func (p *ModelScoop[M]) Replace(b ...bool) *ModelScoop[M]
- func (p *ModelScoop[M]) RightLike(column string, value string) *ModelScoop[M]
- func (p *ModelScoop[M]) Select(fields ...string) *ModelScoop[M]
- func (p *ModelScoop[M]) Unscoped(b ...bool) *ModelScoop[M]
- func (p *ModelScoop[M]) UpdateOrCreate(values map[string]interface{}, m *M) *UpdateOrCreateResult[M]
- func (p *ModelScoop[M]) Where(args ...interface{}) *ModelScoop[M]
- type Options
- type Page
- type Scoop
- func (p *Scoop) AutoMigrate(dst ...interface{}) error
- func (p *Scoop) Begin() *Scoop
- func (p *Scoop) Between(column string, min, max interface{}) *Scoop
- func (p *Scoop) Chunk(dest interface{}, size uint64, fc func(tx *Scoop, offset uint64) error) *ChunkResult
- func (p *Scoop) Commit() *Scoop
- func (p *Scoop) CommitOrRollback(tx *Scoop, logic func(tx *Scoop) error) error
- func (p *Scoop) Count() (uint64, error)
- func (p *Scoop) Create(value interface{}) *CreateResult
- func (p *Scoop) CreateInBatches(value interface{}, batchSize int) *CreateInBatchesResult
- func (p *Scoop) Delete() *DeleteResult
- func (p *Scoop) Equal(column string, value interface{}) *Scoop
- func (p *Scoop) Exist() (bool, error)
- func (p *Scoop) Find(out interface{}) *FindResult
- func (p *Scoop) First(out interface{}) *FirstResult
- func (p *Scoop) Group(fields ...string) *Scoop
- func (p *Scoop) Ignore(b ...bool) *Scoop
- func (p *Scoop) In(column string, values interface{}) *Scoop
- func (p *Scoop) IsNotFound(err error) bool
- func (p *Scoop) LeftLike(column string, value string) *Scoop
- func (p *Scoop) Like(column string, value string) *Scoop
- func (p *Scoop) Limit(limit uint64) *Scoop
- func (p *Scoop) Model(m any) *Scoop
- func (p *Scoop) NotBetween(column string, min, max interface{}) *Scoop
- func (p *Scoop) NotEqual(column string, value interface{}) *Scoop
- func (p *Scoop) NotIn(column string, values interface{}) *Scoop
- func (p *Scoop) NotLeftLike(column string, value string) *Scoop
- func (p *Scoop) NotLike(column string, value string) *Scoop
- func (p *Scoop) NotRightLike(column string, value string) *Scoop
- func (p *Scoop) Offset(offset uint64) *Scoop
- func (p *Scoop) Order(fields ...string) *Scoop
- func (p *Scoop) Replace(b ...bool) *Scoop
- func (p *Scoop) RightLike(column string, value string) *Scoop
- func (p *Scoop) Rollback() *Scoop
- func (p *Scoop) Select(fields ...string) *Scoop
- func (p *Scoop) Unscoped(b ...bool) *Scoop
- func (p *Scoop) Updates(m interface{}) *UpdateResult
- func (p *Scoop) Where(args ...interface{}) *Scoop
- type Tabler
- type UpdateOrCreateResult
- type UpdateResult
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBatchesStop = errors.New("batches stop")
Functions ¶
func Camel2UnderScore ¶
func EnsureIsSliceOrArray ¶
func EscapeMysqlString ¶
func UniqueSlice ¶
func UniqueSlice(s interface{}) interface{}
func UpdateCase ¶
CASE WHEN (`a` = 1) THEN "1" WHEN (`b` = 2) THEN 2 ELSE 10 END
Types ¶
type ChunkResult ¶
type ChunkResult struct {
Error error
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AutoMigrate ¶
type Config ¶
type Config struct { // Database type, support sqlite, mysql, postgres, sqlserver, default sqlite // sqlite: sqlite|sqlite3 // mysql: mysql // postgres: postgres|pg|postgresql|pgsql // sqlserver: sqlserver|mssql Type string `yaml:"type" json:"type"` // Database debug, default false Debug bool `yaml:"debug" json:"debug,omitempty"` // Database address // sqlite: full filepath, default exec path // mysql: database address, default 127.0.0.1 // postgres: database address, default 127.0.0.1 // sqlserver: database address, default 127.0.0.1 Address string `yaml:"address" json:"address,omitempty"` // Database port // sqlite: empty // mysql: database port, default 3306 // postgres: database port, default 5432 // sqlserver: database port, default 1433 Port int `yaml:"port" json:"port,omitempty"` // Database name // sqlite: database file name, default ice.db // mysql: database name, default ice // postgres: database name, default ice // sqlserver: database name, default ice Name string `yaml:"name" json:"name,omitempty"` // Database username // sqlite: empty // mysql: database username // postgres: database username // sqlserver: database username Username string `yaml:"username" json:"username,omitempty"` // Database password // sqlite: empty // mysql: database password // postgres: database password // sqlserver: database password Password string `yaml:"password" json:"password,omitempty"` Logger logger.Interface `json:"-" yaml:"-"` }
type CreateInBatchesResult ¶
type CreateNotExistResult ¶
type CreateOrUpdateResult ¶
type CreateResult ¶
type DeleteResult ¶
type FindResult ¶
type FirstOrCreateResult ¶
type FirstResult ¶
type FirstResult struct {
Error error
}
type ListOption ¶
type ListOption struct { Offset uint64 `json:"offset,omitempty"` Limit uint64 `json:"limit,omitempty"` Options []*Options `json:"options,omitempty"` ShowTotal bool `json:"show_total,omitempty"` }
func NewListOption ¶
func NewListOption() *ListOption
func (*ListOption) AddOption ¶
func (p *ListOption) AddOption(key uint8, value string) *ListOption
func (*ListOption) AddOptions ¶
func (p *ListOption) AddOptions(options ...*Options) *ListOption
func (*ListOption) Clone ¶
func (p *ListOption) Clone() *ListOption
func (*ListOption) Page ¶
func (p *ListOption) Page() *Page
func (*ListOption) Processor ¶
func (p *ListOption) Processor() *ListOptionProcessor
func (*ListOption) SetLimit ¶
func (p *ListOption) SetLimit(limit uint64) *ListOption
func (*ListOption) SetOffset ¶
func (p *ListOption) SetOffset(offset uint64) *ListOption
func (*ListOption) SetOptions ¶
func (p *ListOption) SetOptions(options ...*Options) *ListOption
func (*ListOption) SetShowTotal ¶
func (p *ListOption) SetShowTotal(showTotal ...bool) *ListOption
type ListOptionProcessor ¶
type ListOptionProcessor struct { ListOption *ListOption Handler map[uint8]func(string) error }
func NewListOptionProcessor ¶
func NewListOptionProcessor(option *ListOption) *ListOptionProcessor
func (*ListOptionProcessor) BetweenTimestamp ¶
func (p *ListOptionProcessor) BetweenTimestamp(key uint8, logic func(start, end int64) error) *ListOptionProcessor
func (*ListOptionProcessor) Bool ¶
func (p *ListOptionProcessor) Bool(key uint8, logic func(value bool) error) *ListOptionProcessor
func (*ListOptionProcessor) BoolSlice ¶
func (p *ListOptionProcessor) BoolSlice(key uint8, logic func(value []bool) error) *ListOptionProcessor
func (*ListOptionProcessor) Float32 ¶
func (p *ListOptionProcessor) Float32(key uint8, logic func(value float32) error) *ListOptionProcessor
func (*ListOptionProcessor) Float32Slice ¶
func (p *ListOptionProcessor) Float32Slice(key uint8, logic func(value []float32) error) *ListOptionProcessor
func (*ListOptionProcessor) Float64 ¶
func (p *ListOptionProcessor) Float64(key uint8, logic func(value float64) error) *ListOptionProcessor
func (*ListOptionProcessor) Float64Slice ¶
func (p *ListOptionProcessor) Float64Slice(key uint8, logic func(value []float64) error) *ListOptionProcessor
func (*ListOptionProcessor) Has ¶
func (p *ListOptionProcessor) Has(key uint8, logic func() error) *ListOptionProcessor
func (*ListOptionProcessor) Int ¶
func (p *ListOptionProcessor) Int(key uint8, logic func(value int) error) *ListOptionProcessor
func (*ListOptionProcessor) Int16 ¶
func (p *ListOptionProcessor) Int16(key uint8, logic func(value int16) error) *ListOptionProcessor
func (*ListOptionProcessor) Int16Slice ¶
func (p *ListOptionProcessor) Int16Slice(key uint8, logic func(value []int16) error) *ListOptionProcessor
func (*ListOptionProcessor) Int32 ¶
func (p *ListOptionProcessor) Int32(key uint8, logic func(value int32) error) *ListOptionProcessor
func (*ListOptionProcessor) Int32Slice ¶
func (p *ListOptionProcessor) Int32Slice(key uint8, logic func(value []int32) error) *ListOptionProcessor
func (*ListOptionProcessor) Int64 ¶
func (p *ListOptionProcessor) Int64(key uint8, logic func(value int64) error) *ListOptionProcessor
func (*ListOptionProcessor) Int64Slice ¶
func (p *ListOptionProcessor) Int64Slice(key uint8, logic func(value []int64) error) *ListOptionProcessor
func (*ListOptionProcessor) Int8 ¶
func (p *ListOptionProcessor) Int8(key uint8, logic func(value int8) error) *ListOptionProcessor
func (*ListOptionProcessor) Int8Slice ¶
func (p *ListOptionProcessor) Int8Slice(key uint8, logic func(value []int8) error) *ListOptionProcessor
func (*ListOptionProcessor) IntSlice ¶
func (p *ListOptionProcessor) IntSlice(key uint8, logic func(value []int) error) *ListOptionProcessor
func (*ListOptionProcessor) Order ¶
func (p *ListOptionProcessor) Order(key uint8, logic func(value string) error) *ListOptionProcessor
func (*ListOptionProcessor) Process ¶
func (p *ListOptionProcessor) Process(tx *Scoop, values any) (*Page, error)
func (*ListOptionProcessor) String ¶
func (p *ListOptionProcessor) String(key uint8, logic func(value string) error) *ListOptionProcessor
func (*ListOptionProcessor) StringSlice ¶
func (p *ListOptionProcessor) StringSlice(key uint8, logic func(value []string) error) *ListOptionProcessor
func (*ListOptionProcessor) Timestamp ¶
func (p *ListOptionProcessor) Timestamp(key uint8, logic func(value int64) error) *ListOptionProcessor
func (*ListOptionProcessor) TimestampRange ¶
func (p *ListOptionProcessor) TimestampRange(key uint8, logic func(start, end int64) error) *ListOptionProcessor
func (*ListOptionProcessor) Uint ¶
func (p *ListOptionProcessor) Uint(key uint8, logic func(value uint) error) *ListOptionProcessor
func (*ListOptionProcessor) Uint16 ¶
func (p *ListOptionProcessor) Uint16(key uint8, logic func(value uint16) error) *ListOptionProcessor
func (*ListOptionProcessor) Uint16Slice ¶
func (p *ListOptionProcessor) Uint16Slice(key uint8, logic func(value []uint16) error) *ListOptionProcessor
func (*ListOptionProcessor) Uint32 ¶
func (p *ListOptionProcessor) Uint32(key uint8, logic func(value uint32) error) *ListOptionProcessor
func (*ListOptionProcessor) Uint32Slice ¶
func (p *ListOptionProcessor) Uint32Slice(key uint8, logic func(value []uint32) error) *ListOptionProcessor
func (*ListOptionProcessor) Uint64 ¶
func (p *ListOptionProcessor) Uint64(key uint8, logic func(value uint64) error) *ListOptionProcessor
func (*ListOptionProcessor) Uint64Slice ¶
func (p *ListOptionProcessor) Uint64Slice(key uint8, logic func(value []uint64) error) *ListOptionProcessor
func (*ListOptionProcessor) Uint8 ¶
func (p *ListOptionProcessor) Uint8(key uint8, logic func(value uint8) error) *ListOptionProcessor
func (*ListOptionProcessor) Uint8Slice ¶
func (p *ListOptionProcessor) Uint8Slice(key uint8, logic func(value []uint8) error) *ListOptionProcessor
func (*ListOptionProcessor) UintSlice ¶
func (p *ListOptionProcessor) UintSlice(key uint8, logic func(value []uint) error) *ListOptionProcessor
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
type Model ¶
type Model[M any] struct { // contains filtered or unexported fields }
func (*Model[M]) IsNotFound ¶
func (*Model[M]) NewScoop ¶
func (p *Model[M]) NewScoop(tx ...*Scoop) *ModelScoop[M]
func (*Model[M]) SetNotFound ¶
type ModelScoop ¶
func NewModelScoop ¶
func NewModelScoop[M any](db *gorm.DB) *ModelScoop[M]
func (*ModelScoop[M]) Between ¶
func (p *ModelScoop[M]) Between(column string, min, max interface{}) *ModelScoop[M]
func (*ModelScoop[M]) Chunk ¶
func (p *ModelScoop[M]) Chunk(size uint64, fc func(tx *Scoop, out []*M, offset uint64) error) *ChunkResult
func (*ModelScoop[M]) Create ¶
func (p *ModelScoop[M]) Create(m *M) error
func (*ModelScoop[M]) CreateInBatches ¶
func (p *ModelScoop[M]) CreateInBatches(value []*M, batchSize int) *CreateInBatchesResult
func (*ModelScoop[M]) CreateNotExist ¶
func (p *ModelScoop[M]) CreateNotExist(m *M) *CreateNotExistResult[M]
func (*ModelScoop[M]) CreateOrUpdate ¶
func (p *ModelScoop[M]) CreateOrUpdate(values map[string]interface{}, m *M) *CreateOrUpdateResult[M]
func (*ModelScoop[M]) Equal ¶
func (p *ModelScoop[M]) Equal(column string, value interface{}) *ModelScoop[M]
func (*ModelScoop[M]) Find ¶
func (p *ModelScoop[M]) Find() ([]*M, error)
func (*ModelScoop[M]) First ¶
func (p *ModelScoop[M]) First() (*M, error)
func (*ModelScoop[M]) FirstOrCreate ¶
func (p *ModelScoop[M]) FirstOrCreate(m *M) *FirstOrCreateResult[M]
func (*ModelScoop[M]) Group ¶
func (p *ModelScoop[M]) Group(fields ...string) *ModelScoop[M]
func (*ModelScoop[M]) Ignore ¶
func (p *ModelScoop[M]) Ignore(b ...bool) *ModelScoop[M]
func (*ModelScoop[M]) In ¶
func (p *ModelScoop[M]) In(column string, values interface{}) *ModelScoop[M]
func (*ModelScoop[M]) LeftLike ¶
func (p *ModelScoop[M]) LeftLike(column string, value string) *ModelScoop[M]
func (*ModelScoop[M]) Like ¶
func (p *ModelScoop[M]) Like(column string, value string) *ModelScoop[M]
func (*ModelScoop[M]) Limit ¶
func (p *ModelScoop[M]) Limit(limit uint64) *ModelScoop[M]
func (*ModelScoop[M]) NotBetween ¶
func (p *ModelScoop[M]) NotBetween(column string, min, max interface{}) *ModelScoop[M]
func (*ModelScoop[M]) NotEqual ¶
func (p *ModelScoop[M]) NotEqual(column string, value interface{}) *ModelScoop[M]
func (*ModelScoop[M]) NotIn ¶
func (p *ModelScoop[M]) NotIn(column string, values interface{}) *ModelScoop[M]
func (*ModelScoop[M]) NotLeftLike ¶
func (p *ModelScoop[M]) NotLeftLike(column string, value string) *ModelScoop[M]
func (*ModelScoop[M]) NotLike ¶
func (p *ModelScoop[M]) NotLike(column string, value string) *ModelScoop[M]
func (*ModelScoop[M]) NotRightLike ¶
func (p *ModelScoop[M]) NotRightLike(column string, value string) *ModelScoop[M]
func (*ModelScoop[M]) Offset ¶
func (p *ModelScoop[M]) Offset(offset uint64) *ModelScoop[M]
func (*ModelScoop[M]) Order ¶
func (p *ModelScoop[M]) Order(fields ...string) *ModelScoop[M]
func (*ModelScoop[M]) Replace ¶
func (p *ModelScoop[M]) Replace(b ...bool) *ModelScoop[M]
func (*ModelScoop[M]) RightLike ¶
func (p *ModelScoop[M]) RightLike(column string, value string) *ModelScoop[M]
func (*ModelScoop[M]) Select ¶
func (p *ModelScoop[M]) Select(fields ...string) *ModelScoop[M]
func (*ModelScoop[M]) Unscoped ¶
func (p *ModelScoop[M]) Unscoped(b ...bool) *ModelScoop[M]
func (*ModelScoop[M]) UpdateOrCreate ¶
func (p *ModelScoop[M]) UpdateOrCreate(values map[string]interface{}, m *M) *UpdateOrCreateResult[M]
func (*ModelScoop[M]) Where ¶
func (p *ModelScoop[M]) Where(args ...interface{}) *ModelScoop[M]
type Scoop ¶
type Scoop struct {
// contains filtered or unexported fields
}
func (*Scoop) AutoMigrate ¶
func (*Scoop) CommitOrRollback ¶
func (*Scoop) Create ¶
func (p *Scoop) Create(value interface{}) *CreateResult
func (*Scoop) CreateInBatches ¶
func (p *Scoop) CreateInBatches(value interface{}, batchSize int) *CreateInBatchesResult
func (*Scoop) Delete ¶
func (p *Scoop) Delete() *DeleteResult
func (*Scoop) Find ¶
func (p *Scoop) Find(out interface{}) *FindResult
func (*Scoop) First ¶
func (p *Scoop) First(out interface{}) *FirstResult
func (*Scoop) IsNotFound ¶
func (*Scoop) NotBetween ¶
func (*Scoop) Updates ¶
func (p *Scoop) Updates(m interface{}) *UpdateResult
type UpdateOrCreateResult ¶
type UpdateResult ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.