clause

package
v0.0.0-...-c23fbd1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2026 License: MIT Imports: 1 Imported by: 2

Documentation

Index

Constants

View Source
const (
	AndWithSpace = " AND "
	OrWithSpace  = " OR "
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AndExpr

type AndExpr struct {
	Exprs []Expression
}

func (AndExpr) Build

func (and AndExpr) Build(builder Builder)

type Builder

type Builder interface {
	Writer
	WriteQuoted(field interface{})
	AddVar(Writer, ...interface{})
	AddError(error) error
}

Builder builder interface

type Eq

type Eq struct {
	Column string
	Value  interface{}
}

Eq equal to for where

func (Eq) Build

func (eq Eq) Build(builder Builder)

func (Eq) NegationBuild

func (eq Eq) NegationBuild(builder Builder)

type Expression

type Expression interface {
	Build(builder Builder)
}

Expression expression interface

func And

func And(exprs ...Expression) Expression

func Not

func Not(exprs ...Expression) Expression

func Or

func Or(exprs ...Expression) Expression

type Gt

type Gt Eq

Gt greater than for where

func (Gt) Build

func (gt Gt) Build(builder Builder)

func (Gt) NegationBuild

func (gt Gt) NegationBuild(builder Builder)

type Gte

type Gte Eq

Gte greater than or equal to for where

func (Gte) Build

func (gte Gte) Build(builder Builder)

func (Gte) NegationBuild

func (gte Gte) NegationBuild(builder Builder)

type IN

type IN struct {
	Column string
	Values []interface{}
}

IN Whether a value is within a set of values

func (IN) Build

func (in IN) Build(builder Builder)

func (IN) NegationBuild

func (in IN) NegationBuild(builder Builder)

type Like

type Like Eq

Like whether string matches regular expression

func (Like) Build

func (like Like) Build(builder Builder)

func (Like) NegationBuild

func (like Like) NegationBuild(builder Builder)

type Lt

type Lt Eq

Lt less than for where

func (Lt) Build

func (lt Lt) Build(builder Builder)

func (Lt) NegationBuild

func (lt Lt) NegationBuild(builder Builder)

type Lte

type Lte Eq

Lte less than or equal to for where

func (Lte) Build

func (lte Lte) Build(builder Builder)

func (Lte) NegationBuild

func (lte Lte) NegationBuild(builder Builder)

type NegationExpressionBuilder

type NegationExpressionBuilder interface {
	NegationBuild(builder Builder)
}

NegationExpressionBuilder negation expression builder

type Neq

type Neq Eq

Neq not equal to for where

func (Neq) Build

func (neq Neq) Build(builder Builder)

func (Neq) NegationBuild

func (neq Neq) NegationBuild(builder Builder)

type NotExpr

type NotExpr struct {
	Exprs []Expression
}

func (NotExpr) Build

func (not NotExpr) Build(builder Builder)

type OrExpr

type OrExpr struct {
	Exprs []Expression
}

func (OrExpr) Build

func (or OrExpr) Build(builder Builder)

type OrderBy

type OrderBy struct {
	Column string
	Desc   bool
}

OrderBy 表示排序条件

func (OrderBy) Build

func (o OrderBy) Build(builder Builder)

type OrderBys

type OrderBys []*OrderBy

func (OrderBys) Build

func (o OrderBys) Build(builder Builder)

Build build where clause

type Pagination

type Pagination struct {
	Limit  *int
	Offset int
}

func (Pagination) Build

func (p Pagination) Build(builder Builder)

type Valuer

type Valuer interface {
	Value() (any, error)
}

type Where

type Where struct {
	Exprs []Expression
}

Where where clause

func (Where) Build

func (w Where) Build(builder Builder)

Build build where clause

func (*Where) Merge

func (w *Where) Merge(where Where) *Where

type Writer

type Writer interface {
	WriteByte(byte) error
	WriteString(string) (int, error)
}

Jump to

Keyboard shortcuts

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