Extract parser models

This commit is contained in:
Pijus Kamandulis
2024-02-11 23:14:30 +02:00
parent 50b672a367
commit 12510ea3fa
4 changed files with 347 additions and 388 deletions

48
parsers/models.go Normal file
View 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{}
}