vscode-postgres
vscode-postgres copied to clipboard
Some syntax not supported
Possibly fixed by https://github.com/Borvik/vscode-postgres/projects/2.
begin;
select 1;
commit;
shows syntax errors for begin and commit.
PS: Your extension is awesome! I like the autocompletion, parameter and return type suggestions, and also being able to see multiple result sets at once.
Yeah, it probably would be fixed by that - the challenge is in finding/building a language parser, and then building the language for it. It is rather slow going on that front.
CREATE TYPE processing_state AS ENUM ('loaded', 'all processed', 'error');
Here ENUM shows syntax error. Otherwise excellent work, man!
The following valid sql statements show syntax errors:

I'm seeing these syntax errors as well.
@Borvik any idea why this might be? These errors makes the SQL validation unusable.
Currently the error validation is powered by postgres itself by prepending each statement with an EXPLAIN and running that. Postgres itself is returning these errors.
EXPLAIN was not meant for CREATE/ALTER statements - but works good for SELECT statements.
However creating a whole parser that can do this analysis is tricky at best, but to also create one that can be kept up-to-date with the version of postgres anyone might be connected to... yeah... really not my forte (also this is a side-project I don't really have a lot of time to work on)