pgsql-ast-parser
pgsql-ast-parser copied to clipboard
Fix table alias location tracking
First of all, thanks for this awesome project!
I spotted a bug with the location tracking where table aliases are not tracked if the AS keyword is omitted, for example:
- with the
ASkeyword.
SELECT * FROM test as t
|_______| <- in this case, the tracking works correctly
- without the
ASkeyword.
SELECT * FROM test t
|__| <- in this case, the tracking omits the ` t` part
I have proposed a solution that makes the test pass with a minimal change, but I'm not sure if it's the best approach, as I'm unfamiliar with the codebase, so I would really appreciate suggestions.