Icesource commented on a change in pull request #10383:
URL: https://github.com/apache/shardingsphere/pull/10383#discussion_r636630293
##########
File path:
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DDLStatement.g4
##########
@@ -91,6 +91,18 @@ columnConstraint
: (CONSTRAINT ignoredIdentifier)? (primaryKeyConstraint |
columnForeignKeyConstraint | checkConstraint)
;
+computedColumnConstraint
+ : (CONSTRAINT ignoredIdentifier)? (primaryKeyConstraint |
computedColumnForeignKeyConstraint | checkConstraint)
+ ;
+
+computedColumnForeignKeyConstraint
+ : (FOREIGN KEY)? tableName (LP_ columnName RP_)?
computedColumnForeignKeyOnAction*
+ ;
+
+computedColumnForeignKeyOnAction
+ : ON DELETE (NO ACTION | CASCADE) | ON UPDATE NO ACTION | NOT FOR
REPLICATION
+ ;
+
Review comment:
@jingshanglu I try to extract the same code in ```columnConstraint```
and ```computedColumnConstraint``` into a new syntax. But if I do this,
columnConstraintContext will change so I need to change SQLVistor too. This may
not be a good idea.
```columnConstraint``` and ```computedColumnConstraint``` have similar
syntax but different scenarios. I don't find a good way to eliminate the same
code. Do you have any suggestions?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]