Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Statements = []Statement{ UseStatement, SelectStatement, InsertStatement, ReplaceStatement, UpdateStatement, DeleteStatement, AlterStatement, CreateStatement, DropStatement, }
Functions ¶
This section is empty.
Types ¶
type Create ¶
type Create struct { Type Statement `json:"type"` Keyword string `json:"keyword"` Temporary string `json:"temporary"` Table []struct { DB string `json:"db"` Table string `json:"table"` } `json:"table"` IfNotExists string `json:"if_not_exists"` Like struct { Type string `json:"type"` Table string `json:"table"` Parentheses bool `json:"parentheses"` } `json:"like"` IgnoreReplace string `json:"ignore_replace"` As string `json:"as"` QueryExpr any `json:"query_expr"` CreateDefinitions []any `json:"create_definitions"` TableOptions []any `json:"table_options"` IndexUsing struct { Keyword string `json:"keyword"` Type string `json:"type"` } `json:"index_using"` Index string `json:"index"` OnKw string `json:"on_kw"` IndexColumns []any `json:"index_columns"` IndexType string `json:"index_type"` IndexOptions []any `json:"index_options"` AlgorithmOption struct { Type string `json:"type"` Keyword string `json:"keyword"` Resource string `json:"resource"` Symbol string `json:"symbol"` Algorithm string `json:"algorithm"` } `json:"algorithm_option"` LockOption struct { Type string `json:"type"` Keyword string `json:"keyword"` Resource string `json:"resource"` Symbol string `json:"symbol"` Lock string `json:"lock"` } `json:"lock_option"` Database string `json:"database"` }
type Insert ¶
type Insert struct { Type Statement `json:"type"` DB string `json:"db"` Table any `json:"table"` Columns []any `json:"columns,omitempty"` Values []InsertValue `json:"values"` }
type InsertValue ¶
type Option ¶
type Option struct { StatementPath []any Database *string `json:"database,omitempty"` Type *string `json:"type,omitempty"` TrimQuery *bool `json:"trimQuery,omitempty"` ParseOptions *ParseOptions `json:"parseOptions,omitempty"` }
func (*Option) SetDatabase ¶
func (*Option) SetParseOptions ¶
func (o *Option) SetParseOptions(po *ParseOptions)
func (*Option) SetStatementPath ¶ added in v0.9.0
func (*Option) SetTrimQuery ¶
type ParseOptions ¶
type ParseOptions struct {
IncludeLocations bool `json:"includeLocations,omitempty"`
}
type Replace ¶
type Replace struct { Type Statement `json:"type"` DB string `json:"db"` Table any `json:"table"` Columns []string `json:"columns"` Values []ReplaceValue `json:"values"` }
type ReplaceValue ¶
type Select ¶
type Select struct { Type Statement `json:"type"` With *SelectWith `json:"with"` Options []any `json:"options"` Distinct any `json:"distinct"` Columns []any `json:"columns"` From *SelectFrom `json:"from"` Where any `json:"where"` // Groupby []ColumnRef `json:"groupby"` Having []any `json:"having"` // Orderby []OrderBy `json:"orderby"` // Limit Limit `json:"limit"` // Orderby_ []OrderBy `json:"_orderby"` // Limit_ Limit `json:"_limit"` ParenthesesSymbol bool `json:"parentheses_symbol"` Parentheses bool `json:"_parentheses"` }
type SelectFrom ¶ added in v0.8.0
type SelectFrom []From
type SelectWith ¶ added in v0.9.0
type SelectWith []With
type Statement ¶
type Statement string
const ( UnknownStatement Statement = "" UseStatement Statement = "use" SelectStatement Statement = "select" InsertStatement Statement = "insert" ReplaceStatement Statement = "replace" UpdateStatement Statement = "update" DeleteStatement Statement = "delete" AlterStatement Statement = "alter" CreateStatement Statement = "create" DropStatement Statement = "drop" )
func StatementFrom ¶
Click to show internal directories.
Click to hide internal directories.