Created
January 16, 2023 16:57
-
-
Save ghalimi/55730dd74884b8a95980a8cad51c99b7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# query -> SELECT * FROM table | |
{ | |
"select_query" : { | |
"select_node" : { | |
"projection_list": [ | |
{ | |
"type": "star_expression" | |
} | |
], | |
"from_clause": [ | |
{ | |
"type": "tableref", | |
"table_name": "table" | |
} | |
] | |
} | |
} | |
} |
Yes! I was having ESTree in mind as well when we were talking about this, the example snippet Is just something Mark whipped out in 30 sec as an example when we were discussing this before the meeting. Don't worry, I'll try to make it traversal friendly!
Awesome, thanks !
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It would be easier if all nodes used a
type
, like what ESTree does in JavaScript (AST standard for most JS parsers, including the builtin Firefox one).A tree traverser can then be implemented easily just like a huge
switch/case
on thattype
property.