pgsql-ast-parser icon indicating copy to clipboard operation
pgsql-ast-parser copied to clipboard

Fix table alias location tracking

Open gabotechs opened this issue 2 years ago • 0 comments

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 AS keyword.
SELECT * FROM test as t
              |_______| <- in this case, the tracking works correctly
  • without the AS keyword.
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.

gabotechs avatar Mar 25 '24 21:03 gabotechs