Skip to content

Building a sqlglot query object from a AST? #1043

Closed Answered by barakalon
AdrianBZG asked this question in Q&A
Discussion options

You must be logged in to vote

The Expression.dump method returns a JSON serializable dict for the AST.
The Expression.load class method loads these dicts back into an AST.

You could predict the JSON form of ASTs and use Expression.load.

Or you could just predict SQL and parse the results into an AST.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by barakalon
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants