Added support for 'ORDER BY'

This commit is contained in:
Pijus Kamandulis
2024-02-17 22:26:30 +02:00
parent eb7b3045d2
commit 7339e06eee
6 changed files with 807 additions and 365 deletions

View File

@@ -25,12 +25,20 @@ const (
SelectItemTypeArray
)
type OrderDirection int
const (
OrderDirectionAsc OrderDirection = iota
OrderDirectionDesc
)
type SelectStmt struct {
SelectItems []SelectItem
Table Table
Filters interface{}
Count int
Parameters map[string]interface{}
SelectItems []SelectItem
Table Table
Filters interface{}
Count int
Parameters map[string]interface{}
OrderExpressions []OrderExpression
}
type Table struct {
@@ -60,3 +68,8 @@ type Constant struct {
Type ConstantType
Value interface{}
}
type OrderExpression struct {
SelectItem SelectItem
Direction OrderDirection
}