Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Right now
sqlparser-rsinjects theASkeyword in front of alias names unconditionally. As reported by #1875 or #1784 this leads to problems on Oracle databases. This patch preserves the original absence / presence of the keyword (implicit/explicit aliases) in "table-factor" position when rendered viaDisplay.ASis optional. To unify the implementation within the parser and for clients, representing aliases could then be exposed not as pureIdents but maybe as something as:The parser could be instructed / configured (either by
ParserOptionsor through aDialectsetting) to always produce "explicit" alias tokens. This would then always produce the "AS" keyword when render viaDisplay. Ideally, there would be aVisitorMut::visit_(mut_)aliasand clients could just apply their own setting easily. But this would be rather a nice-to-have.I'd greatly appreciate a critical look since my know-how regarding different DBs is quite limited. I hope I've not broken any of the existing dialects and also hope this PR helps "preserving the syntax round trip".