Describe the bug
I use DuckDB as my database engine and node-sql-parser configured with the Postgresql dialect. While most of the SQL statements work correctly, I encounter an error when trying to parse a DROP VIEW view_name statement.
Database Engine
DuckDB. I am using a parser with Postgresql option
To Reproduce
- Use the
node-sql-parser library with the Postgresql dialect.
- Attempt to parse the following SQL statement:
CREATE or replace VIEW view_name AS SELECT * FROM read_json_auto('https://api.datamuse.com/words?ml=sql');
SELECT * from view_name;
DROP VIEW view_name;
- Got the error
"Expected "--", "/*", ":=", "=", "INDEX", "TABLE", "TO", or [ \t\n\r] but "V" found."
Expected behavior
The node-sql-parser should successfully parse the DROP VIEW statement, as it is valid SQL syntax in the Postgresql dialect.
Describe the bug
I use DuckDB as my database engine and
node-sql-parserconfigured with thePostgresqldialect. While most of the SQL statements work correctly, I encounter an error when trying to parse aDROP VIEW view_namestatement.Database Engine
DuckDB. I am using a parser with Postgresql option
To Reproduce
node-sql-parserlibrary with the Postgresql dialect."Expected "--", "/*", ":=", "=", "INDEX", "TABLE", "TO", or [ \t\n\r] but "V" found."Expected behavior
The node-sql-parser should successfully parse the DROP VIEW statement, as it is valid SQL syntax in the Postgresql dialect.