Open bennieswart opened 1 year ago
Additionally, there are these:
CREATE TYPE kind as ENUM("a", "b");
-- Expected "--", "/*", "INDEX", or [ \t\n\r] but "T" found.
DROP TYPE kind;
-- Expected "$", "(", "--", "/*", "ALTER", "CREATE TABLE", "CREATE", "DELETE", "INSERT", "REPLACE", "SELECT", "UPDATE", "WITH", "return", or [ \t\n\r] but "D" found.
https://www.postgresql.org/docs/current/sql-droptype.html https://www.postgresql.org/docs/current/datatype-enum.html
Thanks!
Same issue with this:
CREATE EXTENSION IF NOT EXISTS "pg_net" WITH SCHEMA "extensions";
-- Expected "--", "/*", "INDEX", or [ \t\n\r] but "E" found.
CREATE OR REPLACE FUNCTION some_func()
-- Expected "--", "/*", "INDEX", or [ \t\n\r] but "O" found.
https://www.postgresql.org/docs/current/sql-createextension.html https://www.postgresql.org/docs/current/sql-createfunction.html
Appreciate the lsp! Works great when not using certain statements
Now we support create/drop type from v1.7.0.
I'm seeing this simple foreign key relation fail to parse:
CREATE TABLE cities (
name varchar(80) primary key,
location point
);
CREATE TABLE weather (
city varchar(80) references cities(name),
temp_lo int,
temp_hi int,
prcp real,
date date
);
I'm pretty sure it's valid code because I just copied it directly from the PostgreSQL manual here: https://www.postgresql.org/docs/current/tutorial-fk.html
This is probably a very similar issue to https://github.com/joe-re/sql-language-server/issues/129 in that it simply requires extension of the parser.
The code I'm hacking on: