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

Does not support the AS keyword #230

Open
iduanyingjie opened this issue Jul 17, 2020 · 3 comments
Open

Does not support the AS keyword #230

iduanyingjie opened this issue Jul 17, 2020 · 3 comments

Comments

@iduanyingjie
Copy link

WX20200717-232610@2x

I didn’t find any field in Statement indicating whether to use the AS field. I think it’s necessary to mark it.

@nickolay
Copy link
Contributor

Why do you need it? I'm not aware of any SQL dialect in which FROM foo bar and FROM foo AS bar have different meaning, and the current AST cannot, by design, preserve all the detail of the source code (I believe the solution to that is #189). So unless there's a good reason to add it, I'm inclined to close this issue.

@iduanyingjie
Copy link
Author

Why do you need it? I'm not aware of any SQL dialect in which FROM foo bar and FROM foo AS bar have different meaning, and the current AST cannot, by design, preserve all the detail of the source code (I believe the solution to that is #189). So unless there's a good reason to add it, I'm inclined to close this issue.

If you want to develop a tool to judge the quality of sql and optimize sql, you need to judge whether there is an as keyword in sql

@nickolay
Copy link
Contributor

Well, I still believe the proper long-term fix that such a tool would require is #189.

But if you can make a case for adding AS specifically (and not any other non-essential syntax) to sqlparser's current AST, we can reconsider. (Is this tool already available?)

If you've only started working on such a tool I think it's best if you started with a fork of sqlparser, so that you can quickly add what you need, and once you have an MVP, we can consider all the changes en-masse.

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

2 participants