JSqlParser icon indicating copy to clipboard operation
JSqlParser copied to clipboard

[FEATURE] Support for CockroachDB

Open andyfrith-rm opened this issue 2 years ago • 1 comments

Grammar or Syntax Description

Can support be added for CockroachDB? It is based on Postgres however there are a few differences which means there are some SQL statements that are considered valid.

SQL Example

Example of missing SQL is the "USING" statement for https://www.cockroachlabs.com/docs/v22.1/hash-sharded-indexes

ALTER TABLE FEATURE_SWITCH_CONFIG ALTER PRIMARY KEY USING COLUMNS (FEATURE_NAME) USING HASH

Caused by: net.sf.jsqlparser.JSQLParserException: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "USING" "USING"
    at line 1, column 53.

Additional context

Tested in version 4.5

andyfrith-rm avatar Mar 10 '23 11:03 andyfrith-rm

Greetings.

Unfortunately the whole ALTER TABLE statement needs a serious refactoring.

ALTER TABLE ... ALTER PRIMARY KEY ... seems to be completely broken to me, not only regarding to your specific syntax.

This thing is so messy, that I would only touch it when a sponsor shows up.

We could maybe start with a SQL:2016 compliant implementation from scratch.

manticore-projects avatar Mar 11 '23 01:03 manticore-projects