Added support for table alias; Make AS keyword optional #9

This commit is contained in:
Pijus Kamandulis
2025-02-03 19:02:12 +02:00
parent e080888c20
commit 8657c48fc8
25 changed files with 2027 additions and 1814 deletions

View File

@@ -50,7 +50,7 @@ func Test_Execute(t *testing.T) {
{Path: []string{"c", "id"}},
{Path: []string{"c", "pk"}},
},
Table: parsers.Table{Value: "c"},
Table: parsers.Table{SelectItem: testutils.SelectItem_Path("c")},
OrderExpressions: []parsers.OrderExpression{
{
SelectItem: parsers.SelectItem{Path: []string{"c", "pk"}},
@@ -79,7 +79,7 @@ func Test_Execute(t *testing.T) {
SelectItems: []parsers.SelectItem{
{Path: []string{"c", "pk"}},
},
Table: parsers.Table{Value: "c"},
Table: parsers.Table{SelectItem: testutils.SelectItem_Path("c")},
GroupBy: []parsers.SelectItem{
{Path: []string{"c", "pk"}},
},
@@ -102,7 +102,7 @@ func Test_Execute(t *testing.T) {
Type: parsers.SelectItemTypeField,
},
},
Table: parsers.Table{Value: "c"},
Table: parsers.Table{SelectItem: testutils.SelectItem_Path("c")},
Filters: parsers.SelectItem{
Type: parsers.SelectItemTypeFunctionCall,
Value: parsers.FunctionCall{
@@ -137,10 +137,9 @@ func Test_Execute(t *testing.T) {
},
},
Table: parsers.Table{
Value: "c",
SelectItem: parsers.SelectItem{
Path: []string{"c", "tags"},
},
Value: "c",
SelectItem: testutils.SelectItem_Path("c", "tags"),
IsInSelect: true,
},
},
mockData,