-
Notifications
You must be signed in to change notification settings - Fork 404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: expose parsing apis #753
Comments
Well, do you personally have a project that would like to take advantage of it, or is it more of an abstract request? The things is, the parser isn't really much of a parser (as in, producing a proper AST), it's very specifically tailored for the needs of the formatter. If you're looking for an SQL parser, you might instead want to consider sql-parser-cst, which I specifically created to overcome the massive limitations that the "parser" in sql-formatter has. It's used by prettier-plugin-sql-cst to format SQL in much better way than will ever be possible with the architecture of SQL Formatter. |
Well, it does support all the syntax of SQLite and BigQuery, but that's indeed very simple SQL compared to all of PostgreSQL, which will need a substantial amount of additional work before it's fully finished. It is though the most complete PostgreSQL parser implementation in JavaScript that I'm aware of. I did quite a lot of experimenting with existing ones before I finally decided to write my own. There's an issue that tracks the progress of Postgres implementation. If a part that's marked as supported in there is not working, then it's indeed worth of opening a ticket. But no real point of opening tickets about the parts of syntax for which nothing has been implemented yet. Then again I haven't even mapped out all the work that remains, like the GRANT/REVOKE syntax that's used at the beginning of that big SQL file you referenced. So it might be worthwhile to open a ticket about that, or just adding a vote for existing tickets for unimplemented stuff. That way I can possibly prioritize implementing the parts that people care the most about. |
it would be amazing if the parsing apis were exported, so other projects can take advantage of them
personally i would love to see the parser being broken into a separate package, but i can understand the maintenance overhead that might require
willing to head up a PR if this is acceptable
The text was updated successfully, but these errors were encountered: