Skip to content
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

Please include SQL comments in ast object #525

Open
labs20 opened this issue Dec 22, 2020 · 3 comments
Open

Please include SQL comments in ast object #525

labs20 opened this issue Dec 22, 2020 · 3 comments
Assignees

Comments

@labs20
Copy link

labs20 commented Dec 22, 2020

As it is now, some proprietary SQL features are not supported, like FOR XML PATH() on SQL Server for example.

As long as it would be nice to eventually have such language support, if the ast object was at least keeping the original SQL comments, it would be possible to us to pre-parse the sql text, transform unknown tags for the parser into comments, and later when rebuilding the sql, either revert back those comments to normal tags or even do custom replacements based on some arbitrary logic.

This would make a lot easier to live with parser limitations.

Thanks!

@JounQin
Copy link
Contributor

JounQin commented Apr 16, 2021

Is there any plain for it? I need location info of AST at the same time.

@cchepelov
Copy link
Contributor

The underlying parser, https://github.com/pegjs/pegjs, has functionality in its main branch to return comments back into the AST. Unfortunately, it is not (yet) part of the latest released version, and it has been a while since there was activity in that repo.

The apparent successor to pegjs is https://github.com/peggyjs/peggy/

@cchepelov
Copy link
Contributor

cchepelov#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants