You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now sqlparser-rs inject the "AS" keyword in front of aliases
unconditionally. As reported by #1875 or #1784 this leads to problems on
Oracle databases. This patch preserves the original absence or presentce of
the keyword in table-factor position. I dubbed the former "implicit" and the
latter "explicit."
1. Some more effort could be invested to apply the same behavior for
select-items (ie. projections in queries) and/or further nodes of the AST with
an alias which "AS" keyword is optional. To unify the implementation within
the parser and make it easier for clients, alias would beg to be exposed not
as pure `Ident`s, but maybe presented as something as:
```rust
struct Alias {
explicit: bool,
name: Ident,
}
impl Deref for Alias {
type Target = Ident;
...
}
impl From<Alias> for Ident {
...
}
```
2. The parser _could_ be instructed / configured (either by `ParserOptions` or
through a `Dialect` setting) to always produce "explicit" alias tokens. This
would then always produce the "AS" keyword when render via `Display`.
Idealy, we'd have `Visitor::visit_alias` and clients could just apply their
own setting quite easily.
0 commit comments