supabase-community / postgres_lsp

A Language Server for Postgres
https://supabase.com
MIT License
3.32k stars 62 forks source link

add support for `SELECT .. ORDER BY ...` #102

Closed mobley-trent closed 9 months ago

mobley-trent commented 10 months ago

51

mobley-trent commented 10 months ago

It didn't seem to be supported with the SELECT statement though. I ran the test initially and the token vector returned by the testing function only had the SELECT and FROM tokens, the ORDER and BY tokens were not returned.

psteinroe commented 10 months ago

Yes, because the tokens are not supposed to be part of the SelectStmt node. If you instead pass the SortBy node to the test function it will return the tokens. Or just add a select with order by to the e2e test. It will pass.