stmt

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

View Source
const (
	InnerJoin = iota
	LeftJoin
	RightJoin
)

Variables

This section is empty.

Functions

func Copy

func Copy(dest, src interface{}) error

func GroupByOf

func GroupByOf(stmt *Select) string

func LimitOf

func LimitOf(stmt interface{}) (int, int)

func NameValueOf

func NameValueOf(stmt *Update) []string

func OrderByOf

func OrderByOf(stmt interface{}) string

func OutputOf

func OutputOf(stmt *Insert) string

func Parse

func Parse(s string) interface{}

func StatementOf

func StatementOf(s interface{}) interface{}

func TableOf

func TableOf(stmt interface{}) string

Types

type Builder

type Builder struct {
}

func Build

func Build() Builder

func (Builder) DeleteFrom added in v0.16.0

func (Builder) DeleteFrom(table string) *Delete

func (Builder) InsertInto

func (Builder) InsertInto(table, fields string) *Insert

func (Builder) Select

func (Builder) Select(fields string) *SelectFields

func (Builder) Update

func (Builder) Update(table string) *Update

type Condition

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

func (*Condition) And

func (c *Condition) And(query string) *Condition

func (*Condition) Or

func (c *Condition) Or(query string) *Condition

type Delete added in v0.16.0

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

func (*Delete) Where added in v0.16.0

func (d *Delete) Where(conditions ...string) *UpdateWhere

type Fields

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

func FieldsOf

func FieldsOf(stmt interface{}) Fields

func (*Fields) AliasByIndex

func (f *Fields) AliasByIndex(i int) string

func (*Fields) Names

func (f *Fields) Names() []string

func (*Fields) ValueByIndex

func (f *Fields) ValueByIndex(i int) string

type GroupBy

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

func (*GroupBy) Limit

func (g *GroupBy) Limit(num ...int) *Select

func (*GroupBy) OrderBy

func (g *GroupBy) OrderBy(orderBy string) *OrderBy

type Insert

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

func (*Insert) Output

func (i *Insert) Output(output string) *InsertValues

func (*Insert) Values

func (i *Insert) Values(values string) *Insert

type InsertValues

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

func (*InsertValues) Values

func (i *InsertValues) Values(values string) *Insert

type OrderBy

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

func (*OrderBy) Limit

func (o *OrderBy) Limit(num ...int) *Select

type Select

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

func (*Select) Count

func (s *Select) Count(count int) *Select

func (*Select) GroupBy

func (s *Select) GroupBy(groupBy string) *GroupBy

func (*Select) InnerJoin

func (s *Select) InnerJoin(table, on string) *Select

func (*Select) LeftJoin

func (s *Select) LeftJoin(table, on string) *Select

func (*Select) Limit

func (s *Select) Limit(num ...int) *Select

func (*Select) Offset

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

func (*Select) OrderBy

func (s *Select) OrderBy(orderBy string) *OrderBy

func (*Select) RightJoin

func (s *Select) RightJoin(table, on string) *Select

func (*Select) Where

func (s *Select) Where(conditions ...string) *SelectWhere

type SelectFields

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

func (SelectFields) From

func (f SelectFields) From(table string) *Select

type SelectWhere

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

func (*SelectWhere) And

func (s *SelectWhere) And(condition string) *SelectWhere

func (*SelectWhere) GroupBy

func (s *SelectWhere) GroupBy(groupBy string) *GroupBy

func (*SelectWhere) Limit

func (s *SelectWhere) Limit(num ...int) *Select

func (*SelectWhere) Or

func (s *SelectWhere) Or(condition string) *SelectWhere

func (*SelectWhere) OrderBy

func (s *SelectWhere) OrderBy(orderBy string) *OrderBy

type Table

type Table struct {
	Name   string
	Alias  string
	Join   uint8
	JoinOn string
}

type Tables

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

func TablesOf

func TablesOf(stmt *Select) Tables

func (*Tables) Names

func (t *Tables) Names() []string

func (*Tables) TableByIndex

func (t *Tables) TableByIndex(i int) Table

type Update

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

func (*Update) Set

func (u *Update) Set(namevalues ...string) *UpdateFields

Set keyvalue pair to set Ex:

UPDATE books SET title = ?, publisher = ?
dbx.Update(`books`).Set(`title = ?`, `publisher = ?`).Set(`publisher = ?`)

type UpdateFields

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

func (*UpdateFields) Where

func (u *UpdateFields) Where(condition string) *UpdateWhere

type UpdateOrderBy added in v0.17.0

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

func (*UpdateOrderBy) Limit added in v0.17.0

func (u *UpdateOrderBy) Limit(count int) *Update

type UpdateWhere

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

func (*UpdateWhere) And

func (u *UpdateWhere) And(condition string) *UpdateWhere

func (*UpdateWhere) Limit added in v0.17.0

func (u *UpdateWhere) Limit(count int) *Update

func (*UpdateWhere) Or

func (u *UpdateWhere) Or(condition string) *UpdateWhere

func (*UpdateWhere) OrderBy added in v0.17.0

func (u *UpdateWhere) OrderBy(orderBy string) *UpdateOrderBy

type WhereParam

type WhereParam struct {
	Condition string
	Or        bool //OR, default: false = AND
}

func WheresOf

func WheresOf(stmt interface{}) []WhereParam

Jump to

Keyboard shortcuts

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