condition

package
v0.0.0-...-b7e028a Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func In

func In(cond ...Builder) edb.Builder

Types

type Builder

type Builder interface {
	Build() (edb.Builder, bool)
}

func And

func And(cond ...Builder) Builder

And creates AND from a list of conditions.

func Eq

func Eq(column string, value interface{}, ok bool) Builder

Eq is `=`. When value is nil, it will be translated to `IS NULL`. When value is a slice, it will be translated to `IN`. Otherwise it will be translated to `=`.

func Gt

func Gt(column string, value interface{}, ok bool) Builder

Gt is `>`.

func Gte

func Gte(column string, value interface{}, ok bool) Builder

Gte is '>='.

func Like

func Like(column, value string, ok bool, escape ...string) Builder

Like is `LIKE`, with an optional `ESCAPE` clause

func Lt

func Lt(column string, value interface{}, ok bool) Builder

Lt is '<'.

func Lte

func Lte(column string, value interface{}, ok bool) Builder

Lte is `<=`.

func Neq

func Neq(column string, value interface{}, ok bool) Builder

Neq is `!=`. When value is nil, it will be translated to `IS NOT NULL`. When value is a slice, it will be translated to `NOT IN`. Otherwise it will be translated to `!=`.

func NotLike

func NotLike(column, value string, ok bool, escape ...string) Builder

NotLike is `NOT LIKE`, with an optional `ESCAPE` clause

func Or

func Or(cond ...Builder) Builder

Or creates OR from a list of conditions.

type Builders

type Builders struct {
	Value []Builder
}

func NewBuilders

func NewBuilders() *Builders

func (*Builders) Append

func (b *Builders) Append(v Builder)

func (*Builders) ScanSelectBuilder

func (b *Builders) ScanSelectBuilder(stmt edb.SelectBuilder)

ScanSelectBuilder 扫描Builder写入查询SQL语句

type Func

type Func func() (edb.Builder, bool)

func (Func) Build

func (b Func) Build() (edb.Builder, bool)

type GroupFunc

type GroupFunc func() (edb.Builder, bool)

func (GroupFunc) Build

func (b GroupFunc) Build() (edb.Builder, bool)

type HavingFunc

type HavingFunc func() (edb.Builder, bool)

func (HavingFunc) Build

func (b HavingFunc) Build() (edb.Builder, bool)

type WhereFunc

type WhereFunc func() (edb.Builder, bool)

func (WhereFunc) Build

func (b WhereFunc) Build() (edb.Builder, bool)

Jump to

Keyboard shortcuts

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