2024-02-11 21:14:30 +00:00
|
|
|
package parsers
|
|
|
|
|
|
|
|
type LogicalExpressionType int
|
|
|
|
|
|
|
|
const (
|
|
|
|
LogicalExpressionTypeOr LogicalExpressionType = iota
|
|
|
|
LogicalExpressionTypeAnd
|
|
|
|
)
|
|
|
|
|
|
|
|
type ConstantType int
|
|
|
|
|
|
|
|
const (
|
|
|
|
ConstantTypeString ConstantType = iota
|
|
|
|
ConstantTypeInteger
|
|
|
|
ConstantTypeFloat
|
|
|
|
ConstantTypeBoolean
|
|
|
|
)
|
|
|
|
|
2024-02-13 19:22:55 +00:00
|
|
|
type SelectItemType int
|
|
|
|
|
|
|
|
const (
|
|
|
|
SelectItemTypeField SelectItemType = iota
|
|
|
|
SelectItemTypeObject
|
|
|
|
SelectItemTypeArray
|
|
|
|
)
|
|
|
|
|
2024-02-11 21:14:30 +00:00
|
|
|
type SelectStmt struct {
|
2024-02-13 19:22:55 +00:00
|
|
|
SelectItems []SelectItem
|
|
|
|
Table Table
|
|
|
|
Filters interface{}
|
2024-02-11 21:14:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Table struct {
|
|
|
|
Value string
|
|
|
|
}
|
|
|
|
|
2024-02-13 19:22:55 +00:00
|
|
|
type SelectItem struct {
|
|
|
|
Alias string
|
|
|
|
Path []string
|
|
|
|
SelectItems []SelectItem
|
|
|
|
Type SelectItemType
|
|
|
|
IsTopLevel bool
|
2024-02-11 21:14:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type LogicalExpression struct {
|
|
|
|
Expressions []interface{}
|
|
|
|
Operation LogicalExpressionType
|
|
|
|
}
|
|
|
|
|
|
|
|
type ComparisonExpression struct {
|
|
|
|
Left interface{}
|
|
|
|
Right interface{}
|
|
|
|
Operation string
|
|
|
|
}
|
|
|
|
|
|
|
|
type Constant struct {
|
|
|
|
Type ConstantType
|
|
|
|
Value interface{}
|
|
|
|
}
|