sql

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatValue added in v0.0.3

func FormatValue(field string) string

func String

func String(s SqlInterface) string

Types

type Batch

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

func NewBatch

func NewBatch(table string) *Batch

func (*Batch) Add

func (b *Batch) Add(insert *Insert) *Batch

func (*Batch) Args

func (b *Batch) Args() []interface{}

func (*Batch) Inserts added in v0.0.3

func (b *Batch) Inserts() []*Insert

func (*Batch) Prepare

func (b *Batch) Prepare() string

func (*Batch) String

func (b *Batch) String() string

type Delete

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

func NewCkDelete added in v0.0.3

func NewCkDelete(table string) *Delete

func NewDelete

func NewDelete(table string) *Delete

func (*Delete) Args

func (d *Delete) Args() []interface{}

func (*Delete) Prepare

func (d *Delete) Prepare() string

func (*Delete) String

func (d *Delete) String() string

func (*Delete) Where

func (d *Delete) Where(w *Where) *Delete

func (*Delete) WhereByList

func (d *Delete) WhereByList(where []string) *Delete

func (*Delete) WhereByMap

func (d *Delete) WhereByMap(where map[string]interface{}) *Delete

type Having

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

func NewHaving

func NewHaving() *Having

func (*Having) Args

func (w *Having) Args() []interface{}

func (*Having) Between

func (w *Having) Between(field string, from interface{}, to interface{}) *Having

func (*Having) Eq

func (w *Having) Eq(field string, value interface{}) *Having

func (*Having) Ge

func (w *Having) Ge(field string, value interface{}) *Having

func (*Having) Gt

func (w *Having) Gt(field string, value interface{}) *Having

func (*Having) In

func (w *Having) In(field string, value []interface{}) *Having

func (*Having) IsNotNull

func (w *Having) IsNotNull(field string) *Having

func (*Having) IsNull

func (w *Having) IsNull(field string) *Having

func (*Having) Le

func (w *Having) Le(field string, value interface{}) *Having

func (*Having) Like

func (w *Having) Like(field string, value interface{}) *Having

func (*Having) Lt

func (w *Having) Lt(field string, value interface{}) *Having

func (*Having) Neq

func (w *Having) Neq(field string, value interface{}) *Having

func (*Having) NotIn

func (w *Having) NotIn(field string, value []interface{}) *Having

func (*Having) OrPrepare

func (w *Having) OrPrepare() string

func (*Having) Prepare

func (w *Having) Prepare() string

func (*Having) Statement

func (w *Having) Statement(statement string) *Having

func (*Having) String

func (w *Having) String() string

type Insert

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

func NewInsert

func NewInsert(table string) *Insert

func (*Insert) Args

func (i *Insert) Args() []interface{}

func (*Insert) Fields added in v0.0.3

func (i *Insert) Fields() []string

func (*Insert) ParseValue added in v0.0.3

func (i *Insert) ParseValue(fields []string)

func (*Insert) Prepare

func (i *Insert) Prepare() string

func (*Insert) Set

func (i *Insert) Set(field string, value interface{}) *Insert

func (*Insert) String

func (i *Insert) String() string

type Select

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

func NewSelect

func NewSelect(table string, alias string) *Select

func (*Select) Args

func (s *Select) Args() []interface{}

func (*Select) Columns

func (s *Select) Columns(columns ...string) *Select

func (*Select) ForUpdate added in v0.0.3

func (s *Select) ForUpdate() *Select

func (*Select) Group

func (s *Select) Group(groups ...string) *Select

func (*Select) Having

func (s *Select) Having(having *Having) *Select

func (*Select) InnerJoin

func (s *Select) InnerJoin(table string, alias string, on string, columns ...string) *Select

func (*Select) LeftJoin

func (s *Select) LeftJoin(table string, alias string, on string, columns ...string) *Select

func (*Select) Limit

func (s *Select) Limit(size int) *Select

func (*Select) Offset

func (s *Select) Offset(offset int) *Select

func (*Select) OrWhere

func (s *Select) OrWhere(where *Where) *Select

func (*Select) Order

func (s *Select) Order(orders ...string) *Select

func (*Select) Prepare

func (s *Select) Prepare() string

func (*Select) RightJoin

func (s *Select) RightJoin(table string, alias string, on string, columns ...string) *Select

func (*Select) String

func (s *Select) String() string

func (*Select) Where

func (s *Select) Where(where *Where) *Select

func (*Select) WhereByList

func (s *Select) WhereByList(where []string) *Select

func (*Select) WhereByMap

func (s *Select) WhereByMap(where map[string]interface{}) *Select

type SqlInterface

type SqlInterface interface {
	Args() []interface{}
	Prepare() string
	String() string
}

type Update

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

func NewCkUpdate added in v0.0.3

func NewCkUpdate(table string) *Update

func NewUpdate

func NewUpdate(table string) *Update

func (*Update) Args

func (u *Update) Args() []interface{}

func (*Update) Prepare

func (u *Update) Prepare() string

func (*Update) Set

func (u *Update) Set(field string, value interface{}) *Update

func (*Update) String

func (u *Update) String() string

func (*Update) Where

func (u *Update) Where(w *Where) *Update

func (*Update) WhereByList

func (u *Update) WhereByList(where []string) *Update

func (*Update) WhereByMap

func (u *Update) WhereByMap(where map[string]interface{}) *Update

type Where

type Where struct {
	Fields []string      `json:"fields"`
	Binds  []interface{} `json:"binds"`
}

func NewWhere

func NewWhere() *Where

func (*Where) Args

func (w *Where) Args() []interface{}

func (*Where) Between

func (w *Where) Between(field string, from interface{}, to interface{}) *Where

func (*Where) Eq

func (w *Where) Eq(field string, value interface{}) *Where

func (*Where) Ge

func (w *Where) Ge(field string, value interface{}) *Where

func (*Where) Gt

func (w *Where) Gt(field string, value interface{}) *Where

func (*Where) In

func (w *Where) In(field string, value []interface{}) *Where

func (*Where) IsNotNull

func (w *Where) IsNotNull(field string) *Where

func (*Where) IsNull

func (w *Where) IsNull(field string) *Where

func (*Where) Le

func (w *Where) Le(field string, value interface{}) *Where

func (*Where) Like

func (w *Where) Like(field string, value interface{}) *Where

func (*Where) Lt

func (w *Where) Lt(field string, value interface{}) *Where

func (*Where) Neq

func (w *Where) Neq(field string, value interface{}) *Where

func (*Where) NotIn

func (w *Where) NotIn(field string, value []interface{}) *Where

func (*Where) OrPrepare

func (w *Where) OrPrepare() string

func (*Where) Prepare

func (w *Where) Prepare() string

func (*Where) Statement

func (w *Where) Statement(statement string) *Where

func (*Where) String

func (w *Where) String() string

Jump to

Keyboard shortcuts

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