Update SQL ASTs
This commit is contained in:
parent
7d5bff29aa
commit
bde073cd36
1 changed files with 58 additions and 59 deletions
117
sql/ast.go
117
sql/ast.go
|
@ -81,15 +81,15 @@ type SelectStatement struct {
|
||||||
KV string `codec:"-"`
|
KV string `codec:"-"`
|
||||||
NS string `codec:"-"`
|
NS string `codec:"-"`
|
||||||
DB string `codec:"-"`
|
DB string `codec:"-"`
|
||||||
Expr []*Field `codec:"-"`
|
Expr []*Field `codec:"expr"`
|
||||||
What []Expr `codec:"-"`
|
What []Expr `codec:"what"`
|
||||||
Cond []Expr `codec:"-"`
|
Cond []Expr `codec:"cond"`
|
||||||
Group []*Group `codec:"-"`
|
Group []*Group `codec:"group"`
|
||||||
Order []*Order `codec:"-"`
|
Order []*Order `codec:"order"`
|
||||||
Limit Expr `codec:"-"`
|
Limit Expr `codec:"limit"`
|
||||||
Start Expr `codec:"-"`
|
Start Expr `codec:"start"`
|
||||||
Version Expr `codec:"-"`
|
Version Expr `codec:"version"`
|
||||||
Echo Token `codec:"-"`
|
Echo Token `codec:"echo"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateStatement represents a SQL CREATE statement.
|
// CreateStatement represents a SQL CREATE statement.
|
||||||
|
@ -98,9 +98,9 @@ type CreateStatement struct {
|
||||||
KV string `codec:"-"`
|
KV string `codec:"-"`
|
||||||
NS string `codec:"-"`
|
NS string `codec:"-"`
|
||||||
DB string `codec:"-"`
|
DB string `codec:"-"`
|
||||||
What []Expr `codec:"-"`
|
What []Expr `codec:"what"`
|
||||||
Data []Expr `codec:"-"`
|
Data []Expr `codec:"data"`
|
||||||
Echo Token `codec:"-"`
|
Echo Token `codec:"echo"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateStatement represents a SQL UPDATE statement.
|
// UpdateStatement represents a SQL UPDATE statement.
|
||||||
|
@ -109,10 +109,10 @@ type UpdateStatement struct {
|
||||||
KV string `codec:"-"`
|
KV string `codec:"-"`
|
||||||
NS string `codec:"-"`
|
NS string `codec:"-"`
|
||||||
DB string `codec:"-"`
|
DB string `codec:"-"`
|
||||||
What []Expr `codec:"-"`
|
What []Expr `codec:"what"`
|
||||||
Data []Expr `codec:"-"`
|
Data []Expr `codec:"data"`
|
||||||
Cond []Expr `codec:"-"`
|
Cond []Expr `codec:"cond"`
|
||||||
Echo Token `codec:"-"`
|
Echo Token `codec:"echo"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ModifyStatement represents a SQL MODIFY statement.
|
// ModifyStatement represents a SQL MODIFY statement.
|
||||||
|
@ -121,10 +121,10 @@ type ModifyStatement struct {
|
||||||
KV string `codec:"-"`
|
KV string `codec:"-"`
|
||||||
NS string `codec:"-"`
|
NS string `codec:"-"`
|
||||||
DB string `codec:"-"`
|
DB string `codec:"-"`
|
||||||
What []Expr `codec:"-"`
|
What []Expr `codec:"what"`
|
||||||
Diff []Expr `codec:"-"`
|
Diff []Expr `codec:"diff"`
|
||||||
Cond []Expr `codec:"-"`
|
Cond []Expr `codec:"cond"`
|
||||||
Echo Token `codec:"-"`
|
Echo Token `codec:"echo"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteStatement represents a SQL DELETE statement.
|
// DeleteStatement represents a SQL DELETE statement.
|
||||||
|
@ -133,10 +133,10 @@ type DeleteStatement struct {
|
||||||
KV string `codec:"-"`
|
KV string `codec:"-"`
|
||||||
NS string `codec:"-"`
|
NS string `codec:"-"`
|
||||||
DB string `codec:"-"`
|
DB string `codec:"-"`
|
||||||
Hard bool `codec:"-"`
|
Hard bool `codec:"hard"`
|
||||||
What []Expr `codec:"-"`
|
What []Expr `codec:"what"`
|
||||||
Cond []Expr `codec:"-"`
|
Cond []Expr `codec:"cond"`
|
||||||
Echo Token `codec:"-"`
|
Echo Token `codec:"echo"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// RelateStatement represents a SQL RELATE statement.
|
// RelateStatement represents a SQL RELATE statement.
|
||||||
|
@ -145,24 +145,45 @@ type RelateStatement struct {
|
||||||
KV string `codec:"-"`
|
KV string `codec:"-"`
|
||||||
NS string `codec:"-"`
|
NS string `codec:"-"`
|
||||||
DB string `codec:"-"`
|
DB string `codec:"-"`
|
||||||
Type []Expr `codec:"-"`
|
Type []Expr `codec:"type"`
|
||||||
From []Expr `codec:"-"`
|
From []Expr `codec:"from"`
|
||||||
To []Expr `codec:"-"`
|
To []Expr `codec:"to"`
|
||||||
Data []Expr `codec:"-"`
|
Data []Expr `codec:"data"`
|
||||||
Echo Token `codec:"-"`
|
Echo Token `codec:"echo"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// RecordStatement represents a SQL CREATE EVENT statement.
|
// RecordStatement represents a SQL RECORD statement.
|
||||||
type RecordStatement struct {
|
type RecordStatement struct {
|
||||||
EX bool `codec:"-"`
|
EX bool `codec:"-"`
|
||||||
KV string `codec:"-"`
|
KV string `codec:"-"`
|
||||||
NS string `codec:"-"`
|
NS string `codec:"-"`
|
||||||
DB string `codec:"-"`
|
DB string `codec:"-"`
|
||||||
Type []Expr `codec:"-"`
|
Type []Expr `codec:"type"`
|
||||||
On []Expr `codec:"-"`
|
When Expr `codec:"when"`
|
||||||
At Expr `codec:"-"`
|
Data []Expr `codec:"data"`
|
||||||
Data []Expr `codec:"-"`
|
Echo Token `codec:"echo"`
|
||||||
Echo Token `codec:"-"`
|
}
|
||||||
|
|
||||||
|
// --------------------------------------------------
|
||||||
|
// Table
|
||||||
|
// --------------------------------------------------
|
||||||
|
|
||||||
|
// DefineTableStatement represents an SQL DEFINE TABLE statement.
|
||||||
|
type DefineTableStatement struct {
|
||||||
|
EX bool `codec:"-"`
|
||||||
|
KV string `codec:"-"`
|
||||||
|
NS string `codec:"-"`
|
||||||
|
DB string `codec:"-"`
|
||||||
|
What []string `codec:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// RemoveTableStatement represents an SQL REMOVE TABLE statement.
|
||||||
|
type RemoveTableStatement struct {
|
||||||
|
EX bool `codec:"-"`
|
||||||
|
KV string `codec:"-"`
|
||||||
|
NS string `codec:"-"`
|
||||||
|
DB string `codec:"-"`
|
||||||
|
What []string `codec:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
@ -191,33 +212,11 @@ type RemoveRulesStatement struct {
|
||||||
When []string `codec:"-"`
|
When []string `codec:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------------------------------
|
|
||||||
// Table
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
// DefineTableStatement represents an SQL DEFINE TABLE statement.
|
|
||||||
type DefineTableStatement struct {
|
|
||||||
EX bool `codec:"-"`
|
|
||||||
KV string `codec:"-"`
|
|
||||||
NS string `codec:"-"`
|
|
||||||
DB string `codec:"-"`
|
|
||||||
What []string `codec:"-"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// RemoveTableStatement represents an SQL REMOVE TABLE statement.
|
|
||||||
type RemoveTableStatement struct {
|
|
||||||
EX bool `codec:"-"`
|
|
||||||
KV string `codec:"-"`
|
|
||||||
NS string `codec:"-"`
|
|
||||||
DB string `codec:"-"`
|
|
||||||
What []string `codec:"-"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
// Field
|
// Field
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
||||||
// DefineFieldStatement represents an SQL DEFINE INDEX statement.
|
// DefineFieldStatement represents an SQL DEFINE FIELD statement.
|
||||||
type DefineFieldStatement struct {
|
type DefineFieldStatement struct {
|
||||||
EX bool `codec:"-"`
|
EX bool `codec:"-"`
|
||||||
KV string `codec:"-"`
|
KV string `codec:"-"`
|
||||||
|
@ -238,7 +237,7 @@ type DefineFieldStatement struct {
|
||||||
Validate bool `codec:"validate"`
|
Validate bool `codec:"validate"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// RemoveFieldStatement represents an SQL REMOVE INDEX statement.
|
// RemoveFieldStatement represents an SQL REMOVE FIELD statement.
|
||||||
type RemoveFieldStatement struct {
|
type RemoveFieldStatement struct {
|
||||||
EX bool `codec:"-"`
|
EX bool `codec:"-"`
|
||||||
KV string `codec:"-"`
|
KV string `codec:"-"`
|
||||||
|
|
Loading…
Reference in a new issue