mirror of
https://github.com/pikami/cosmium.git
synced 2025-12-19 17:00:37 +00:00
Extract parser models
This commit is contained in:
48
parsers/models.go
Normal file
48
parsers/models.go
Normal file
@@ -0,0 +1,48 @@
|
||||
package parsers
|
||||
|
||||
type LogicalExpressionType int
|
||||
|
||||
const (
|
||||
LogicalExpressionTypeOr LogicalExpressionType = iota
|
||||
LogicalExpressionTypeAnd
|
||||
)
|
||||
|
||||
type ConstantType int
|
||||
|
||||
const (
|
||||
ConstantTypeString ConstantType = iota
|
||||
ConstantTypeInteger
|
||||
ConstantTypeFloat
|
||||
ConstantTypeBoolean
|
||||
)
|
||||
|
||||
type SelectStmt struct {
|
||||
Columns []FieldPath
|
||||
Table Table
|
||||
Filters interface{}
|
||||
}
|
||||
|
||||
type Table struct {
|
||||
Value string
|
||||
}
|
||||
|
||||
type FieldPath struct {
|
||||
Alias string
|
||||
Path []string
|
||||
}
|
||||
|
||||
type LogicalExpression struct {
|
||||
Expressions []interface{}
|
||||
Operation LogicalExpressionType
|
||||
}
|
||||
|
||||
type ComparisonExpression struct {
|
||||
Left interface{}
|
||||
Right interface{}
|
||||
Operation string
|
||||
}
|
||||
|
||||
type Constant struct {
|
||||
Type ConstantType
|
||||
Value interface{}
|
||||
}
|
||||
Reference in New Issue
Block a user