Documentation ¶
Index ¶
- func Delete(builder sqlbuilder.DeleteBuilder, conditions ...Condition) sqlbuilder.DeleteBuilder
- func Select(sb sqlbuilder.SelectBuilder, conditions ...Condition) sqlbuilder.SelectBuilder
- func Update(builder sqlbuilder.UpdateBuilder, conditions ...Condition) sqlbuilder.UpdateBuilder
- func WithOrValuesFunc(valueFunc func() []any) opts.Opt[ChainOperatorOpts]
- func WithSkip(skip bool) opts.Opt[ChainOperatorOpts]
- func WithSkipFunc(skipFunc func() bool) opts.Opt[ChainOperatorOpts]
- func WithValueFunc(valueFunc func() 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, operators []Operator, values []any, ...) 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 Delete ¶ added in v0.12.0
func Delete(builder sqlbuilder.DeleteBuilder, conditions ...Condition) sqlbuilder.DeleteBuilder
func Select ¶ added in v0.12.0
func Select(sb sqlbuilder.SelectBuilder, conditions ...Condition) sqlbuilder.SelectBuilder
func Update ¶ added in v0.12.0
func Update(builder sqlbuilder.UpdateBuilder, conditions ...Condition) sqlbuilder.UpdateBuilder
func WithOrValuesFunc ¶ added in v0.12.1
func WithOrValuesFunc(valueFunc func() []any) opts.Opt[ChainOperatorOpts]
func WithSkipFunc ¶ added in v0.10.0
func WithSkipFunc(skipFunc func() bool) opts.Opt[ChainOperatorOpts]
func WithValueFunc ¶ added in v0.12.1
func WithValueFunc(valueFunc func() any) 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" NotBetween Operator = "NOT BETWEEN" OrderBy Operator = "ORDER BY" )
Click to show internal directories.
Click to hide internal directories.