Added support for array selects

This commit is contained in:
Pijus Kamandulis
2024-02-13 21:57:33 +02:00
parent e89f2e5611
commit 5d2b21dc46
7 changed files with 513 additions and 295 deletions
+20
View File
@@ -65,6 +65,26 @@ func Test_Parse(t *testing.T) {
)
})
t.Run("Should parse SELECT array", func(t *testing.T) {
testQueryParse(
t,
`SELECT [c.id, c.pk] as arr FROM c`,
parsers.SelectStmt{
SelectItems: []parsers.SelectItem{
{
Alias: "arr",
Type: parsers.SelectItemTypeArray,
SelectItems: []parsers.SelectItem{
{Path: []string{"c", "id"}},
{Path: []string{"c", "pk"}},
},
},
},
Table: parsers.Table{Value: "c"},
},
)
})
t.Run("Should parse SELECT with single WHERE condition", func(t *testing.T) {
testQueryParse(
t,