mcbrewster / druid-sql-parser Goto Github PK
View Code? Open in Web Editor NEWParses Sql to an AST and re-stringifies SQL ASTs
License: MIT License
Parses Sql to an AST and re-stringifies SQL ASTs
License: MIT License
If I feed the following query to the parser it will break:
select x2 from y
The error:
throw peg$buildStructuredError(
^
SyntaxError: Expected "'", "(", "*", "AS", "CASE", "DISTINCT", "FROM", "GROUP BY", "HAVING", "LIMIT", "ORDER BY", "UNION ALL", "WHERE", "\"", [ \t\n\r(),;], [a-zA-Z_.], [a-z_], or end of input but "2" found.
Suppose I am trying to parse the following query:
const ast = parser.parse('select concat(count(x), y) from z');
The way I see it when I parse it I should get ast.selectParts be an array with a length of 1, however it has a length of 2, and the first element it considers to be a constant with the value "concat", equivalent to if I had wrote 'select "concat"...'. The second argument also doesn't seem to be correctly deduced, it says it is a function with 2 arguments, and those arguments are x and y.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.