taozhi8833998 / node-sql-parser

Parse simple SQL statements into an abstract syntax tree (AST) with the visited tableList and convert it back to SQL
https://taozhi8833998.github.io/node-sql-parser/
Apache License 2.0
780 stars 174 forks source link

Parsing fails on ARRAY in postgres #1991

Closed 1ilit closed 1 month ago

1ilit commented 2 months ago

Describe the bug Throws syntax error when the datatype is an ARRAY or is defined using [] and has a length

Database Engine PostgreSQL

To Reproduce -the SQL that be parsed

CREATE TABLE "table_0" (
    "hi" INTEGER ARRAY
);

CREATE TABLE "table_1" (
    "hi" INTEGER[3]
);

-the node-sql-parser version v5.2.0 -the node version v20.11.0

Expected behavior Produce AST