3 ms·
Yep, it depends on what you want to do. Validating the SQL is correct is handy -- of course, but sometimes you need the AST.
by thejosh 4y ago
Yep, it depends on what you want to do. Validating the SQL is correct is handy -- of course, but sometimes you need the AST.
- sanxiyn 4y agopg_query does return the AST.
- valenterry 4y agoHow do I pass my programming language as parameter to it?
- emaginniss 4y agoWhy would you need to pass in your language? The AST is data. You can then take that AST, which is already validated and disambiguated and act upon it in any way that you'd like.
- valenterry 4y agoBecause I want to analyze and transform the AST with the tools and libraries that my programming language offers. To be more precise, I want the data to be datatypes of my programming language and not JSON or some custom structure that I have to first parse myself.