goMySQL

package module
v0.0.0-...-32e917f Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Expr

type Expr struct {
	Field string
	Op    Operator
	Value interface{}
}

func (*Expr) String

func (e *Expr) String() string

type ExprNode

type ExprNode struct {
	Node     *Expr
	Relation Relation
	Next     *ExprNode
}

func (*ExprNode) String

func (e *ExprNode) String() string

func (*ExprNode) Value

func (e *ExprNode) Value() interface{}

type Expression

type Expression struct {
	// contains filtered or unexported fields
}

func (*Expression) AddClause

func (e *Expression) AddClause(clauses ...string) error

func (*Expression) AddExpr

func (e *Expression) AddExpr(expr *Expr)

func (*Expression) AndClause

func (e *Expression) AndClause(clauses ...string) error

func (*Expression) AndExpr

func (e *Expression) AndExpr(field string, op Operator, value interface{})

func (*Expression) IsEmpty

func (e *Expression) IsEmpty() bool

func (*Expression) OrClause

func (e *Expression) OrClause(clauses ...string) error

func (*Expression) OrExpr

func (e *Expression) OrExpr(field string, op Operator, value interface{})

func (*Expression) String

func (e *Expression) String() string

func (*Expression) Value

func (e *Expression) Value() []interface{}

type Operator

type Operator uint

Operator 操作符 取值:{EQ,NEQ,LT,ELT,GT,EGT}

Example
fmt.Println(EQ.String())
fmt.Println(NEQ.String())
fmt.Println(GT.String())
fmt.Println(EGT.String())
fmt.Println(LT.String())
fmt.Println(ELT.String())
Output:

=
<>
>
>=
<
<=
const (
	EQ  Operator = iota //EQ 等于(=)
	NEQ                 //NEQ 不等于(<>)
	LT                  //LT 小于(<)
	ELT                 //ELT 小于等于(<=)
	GT                  //GT 大于(>)
	EGT                 //EGT 大于等于(>=)
)

func (Operator) String

func (op Operator) String() string

type Relation

type Relation uint

Relation 表达式节点间关系 取值:{NONE, And, Or}

const (
	NONE Relation = iota
	And
	Or
)

func (Relation) String

func (r Relation) String() string

Jump to

Keyboard shortcuts

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