I find this structure confusing.
The ORDER BY in the query relates to the Name column in the second subquery (right), not to the whole unionized query.
so why would the "order_by" field in the JSON be outside of the separation between them? How can I tell to which one of the two it relates? (And inside the "right" section there's no data about the ORDER BY clause.)
Hi @niryarden, the format of the AST is not API stable and is something we inherit directly from upstream (sqlparser-rs). If you have questions about the output I would go ahead and open an issue there.
When I run parse_sql on this query:
I receive the JSON (removed irrelevant parts):
I find this structure confusing. The ORDER BY in the query relates to the Name column in the second subquery (right), not to the whole unionized query. so why would the "order_by" field in the JSON be outside of the separation between them? How can I tell to which one of the two it relates? (And inside the "right" section there's no data about the ORDER BY clause.)