condx

package
v0.0.0-...-d3b5644 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All(subquery string) string

All generates an 'ALL (subquery)' condition

func Any

func Any(subquery string) string

Any generates an 'ANY (subquery)' condition

func AppendJsonArrayContains

func AppendJsonArrayContains(conds []string, field string, value string) []string

func AppendLikes

func AppendLikes(conds []string, field string, values []string) []string

func Between

func Between(conds []string, field, minValue, maxValue string) []string

func Equal

func Equal(conds []string, field string, value any) []string

Equal generates an 'expression1 = expression2' condition and appends it to an existing list of conditions.

func Exists

func Exists(conds []string, subquery string) []string

Exists generates an 'EXISTS (subquery)' condition

func GreaterThan

func GreaterThan(conds []string, field string, value any) []string

GreaterThan generates an 'expression1 > expression2' condition and appends it to an existing list of conditions.

func GreaterThanEqual

func GreaterThanEqual(conds []string, field string, value any) []string

GreaterThanEqual generates an 'expression1 >= expression2' condition and appends it to an existing list of conditions.

func Having

func Having(conds []string, op Combiner) string

func In

func In(conds []string, field string, values []string) []string

func IsNotNull

func IsNotNull(conds []string, field string) []string

func IsNull

func IsNull(conds []string, field string) []string

func LessThan

func LessThan(conds []string, field string, value any) []string

LessThan generates an 'expression1 < expression2' condition and appends it to an existing list of conditions.

func LessThanEqual

func LessThanEqual(conds []string, field string, value any) []string

LessThanEqual generates an 'expression1 <= expression2' condition and appends it to an existing list of conditions.

func Like

func Like(conds []string, field string, value string) []string

func NotBetween

func NotBetween(conds []string, field, minValue, maxValue string) []string

func NotEqual

func NotEqual(conds []string, field string, value any) []string

NotEqual generates an 'expression1 <> expression2' condition and appends it to an existing list of conditions.

func NotExists

func NotExists(conds []string, subquery string) []string

NotExists generates an 'NOT EXISTS (subquery)' condition

func NotIn

func NotIn(conds []string, field string, values []string) []string

func NotLike

func NotLike(conds []string, field string, value string) []string

func On

func On(conds []string) string

func Where

func Where(conds []string, op Combiner) string

Types

type BoolStringfy

type BoolStringfy struct{}

func (BoolStringfy) ToString

func (s BoolStringfy) ToString(value any) string

type Combiner

type Combiner interface {
	Combine(conds []string) string
}

func And

func And() Combiner

func Or

func Or() Combiner

type Comparator

type Comparator interface {
	Compare(conds []string, field string, value any) []string
}

type DecodeHookFuncKind

type DecodeHookFuncKind func(reflect.Kind, any) (string, error)

type DecodeHookFuncType

type DecodeHookFuncType func(reflect.Type, any) (string, error)

type DecodeHookFuncValue

type DecodeHookFuncValue func(reflect.Value) (string, error)

type Stringfy

type Stringfy interface {
	ToString(value any) string
}

Jump to

Keyboard shortcuts

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