Documentation
¶
Index ¶
- func Apply(sb *sqlbuilder.SelectBuilder, conditions ...Condition)
- func ApplyDelete(sb *sqlbuilder.DeleteBuilder, conditions ...Condition)
- func ApplySelect(sb *sqlbuilder.SelectBuilder, conditions ...Condition)
- func ApplyUpdate(sb *sqlbuilder.UpdateBuilder, conditions ...Condition)
- func WithOrValues(orValues []any) opts.Opt[ChainOperatorOpts]
- func WithSkip(skip bool) opts.Opt[ChainOperatorOpts]
- func WithSkipFunc(skipFunc func() bool) opts.Opt[ChainOperatorOpts]
- func WithValue(value any) opts.Opt[ChainOperatorOpts]
- type Chain
- func (c Chain) Between(field string, value any, op ...opts.Opt[ChainOperatorOpts]) Chain
- func (c Chain) Build() []Condition
- func (c Chain) Equal(field string, value any, op ...opts.Opt[ChainOperatorOpts]) Chain
- func (c Chain) GreaterEqualThan(field string, value any, op ...opts.Opt[ChainOperatorOpts]) Chain
- func (c Chain) GreaterThan(field string, value any, op ...opts.Opt[ChainOperatorOpts]) Chain
- func (c Chain) In(field string, values any, op ...opts.Opt[ChainOperatorOpts]) Chain
- func (c Chain) LessEqualThan(field string, value any, op ...opts.Opt[ChainOperatorOpts]) Chain
- func (c Chain) LessThan(field string, value any, op ...opts.Opt[ChainOperatorOpts]) Chain
- func (c Chain) Like(field string, value any, op ...opts.Opt[ChainOperatorOpts]) Chain
- func (c Chain) Limit(value any, op ...opts.Opt[ChainOperatorOpts]) Chain
- func (c Chain) NotEqual(field string, value any, op ...opts.Opt[ChainOperatorOpts]) Chain
- func (c Chain) NotIn(field string, value any, op ...opts.Opt[ChainOperatorOpts]) Chain
- func (c Chain) NotLike(field string, value any, op ...opts.Opt[ChainOperatorOpts]) Chain
- func (c Chain) Offset(value any, op ...opts.Opt[ChainOperatorOpts]) Chain
- func (c Chain) Or(fields []string, values []any, op ...opts.Opt[ChainOperatorOpts]) Chain
- func (c Chain) OrderBy(value any, op ...opts.Opt[ChainOperatorOpts]) Chain
- func (c Chain) Page(page, pageSize int, op ...opts.Opt[ChainOperatorOpts]) Chain
- type ChainOperatorOpts
- type Condition
- type Operator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
func Apply(sb *sqlbuilder.SelectBuilder, conditions ...Condition)
func ApplyDelete ¶ added in v0.5.0
func ApplyDelete(sb *sqlbuilder.DeleteBuilder, conditions ...Condition)
func ApplySelect ¶ added in v0.5.0
func ApplySelect(sb *sqlbuilder.SelectBuilder, conditions ...Condition)
func ApplyUpdate ¶ added in v0.5.0
func ApplyUpdate(sb *sqlbuilder.UpdateBuilder, conditions ...Condition)
func WithOrValues ¶ added in v0.10.0
func WithOrValues(orValues []any) opts.Opt[ChainOperatorOpts]
func WithSkipFunc ¶ added in v0.10.0
func WithSkipFunc(skipFunc func() bool) opts.Opt[ChainOperatorOpts]
Types ¶
type Chain ¶ added in v0.8.0
type Chain struct {
// contains filtered or unexported fields
}
func NewChainWithConditions ¶ added in v0.8.0
func (Chain) GreaterEqualThan ¶ added in v0.8.0
func (Chain) GreaterThan ¶ added in v0.8.0
func (Chain) LessEqualThan ¶ added in v0.8.0
type ChainOperatorOpts ¶ added in v0.10.0
type ChainOperatorOpts struct {
Skip bool
SkipFunc func() bool
ValueFunc func() any
OrValuesFunc func() []any
}
func (ChainOperatorOpts) DefaultOptions ¶ added in v0.10.0
func (opts ChainOperatorOpts) DefaultOptions() ChainOperatorOpts
type Condition ¶
type Operator ¶ added in v0.4.0
type Operator string
const ( Equal Operator = "=" NotEqual Operator = "!=" GreaterThan Operator = ">" LessThan Operator = "<" GreaterEqualThan Operator = ">=" LessEqualThan Operator = "<=" In Operator = "IN" NotIn Operator = "NOT IN" Like Operator = "LIKE" NotLike Operator = "NOT LIKE" Limit Operator = "LIMIT" Offset Operator = "OFFSET" Between Operator = "BETWEEN" OrderBy Operator = "ORDER BY" )
Click to show internal directories.
Click to hide internal directories.