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 []string `json:"columns"`
Values []InsertValue `json:"values"`
}
type InsertValue ¶
type Option ¶
type Option struct {
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) SetTrimQuery ¶
type ParseOptions ¶
type ParseOptions struct {
IncludeLocations bool
}
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 []With `json:"with"`
Options []any `json:"options"`
Distinct string `json:"distinct"`
Columns []any `json:"columns"`
// From []From `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 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.