Documentation
¶
Index ¶
- func GroupByOf(stmt *SelectStmt) []string
- func LimitOf(stmt *SelectStmt) (int, int)
- func OrderByOf(stmt *SelectStmt) []string
- func StatementOf(q interface{}) interface{}
- func ValueOf(stmt interface{}) []string
- func WhereOf(stmt interface{}) []string
- type Condition
- type Field
- type GroupBy
- type InsertStmt
- type OrderBy
- type SelectStmt
- type Table
- type TableStmt
- func (t *TableStmt) GroupBy(groupBy string) *GroupBy
- func (t *TableStmt) InnerJoin(table, condition string) *TableStmt
- func (t *TableStmt) Join(joinKind, table, condition string) *TableStmt
- func (t *TableStmt) LeftJoin(table, condition string) *TableStmt
- func (t *TableStmt) Limit(num ...int) *TableStmt
- func (t *TableStmt) OrderBy(orders string) *OrderBy
- func (t *TableStmt) RightJoin(table, condition string) *TableStmt
- func (t *TableStmt) Where(condition string) *Where
- type UpdateStmt
- type Where
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GroupByOf ¶
func GroupByOf(stmt *SelectStmt) []string
func LimitOf ¶
func LimitOf(stmt *SelectStmt) (int, int)
func OrderByOf ¶
func OrderByOf(stmt *SelectStmt) []string
func StatementOf ¶
func StatementOf(q interface{}) interface{}
Types ¶
type InsertStmt ¶
type InsertStmt struct {
// contains filtered or unexported fields
}
func InsertInto ¶
func InsertInto(table string, fields string) *InsertStmt
func (*InsertStmt) Values ¶
func (i *InsertStmt) Values(query string) *InsertStmt
type SelectStmt ¶
type SelectStmt struct {
// contains filtered or unexported fields
}
func ParseSelect ¶
func ParseSelect(query string) *SelectStmt
func Select ¶
func Select(query string) *SelectStmt
func (*SelectStmt) From ¶
func (s *SelectStmt) From(table string) *TableStmt
From table name with or without alias. Ex: Without alias => "Select books.* From books" With alias => "Select b.* From books b"
type TableStmt ¶
type TableStmt struct {
// contains filtered or unexported fields
}
func TableStmtOf ¶
func TableStmtOf(stmt *SelectStmt) *TableStmt
func (*TableStmt) Limit ¶
Limit used by MySQL. Parameters 'num' can be single int for "LIMIT n" or double for "LIMIT n1, n2" Ex: SELECT * FROM books LIMIT 1. offset = 0, length = 1 SELECT * FROM books LIMIT 0, 10. offset = 0, length = 10
type UpdateStmt ¶
type UpdateStmt struct {
// contains filtered or unexported fields
}
func NewUpdate ¶
func NewUpdate(table string) *UpdateStmt
func Update ¶
func Update(table string) *UpdateStmt
func (*UpdateStmt) Set ¶
func (u *UpdateStmt) Set(query string) *UpdateStmt
func (*UpdateStmt) Where ¶
func (u *UpdateStmt) Where(condition string) *Condition
Click to show internal directories.
Click to hide internal directories.