shengdoupi opened a new issue, #30305:
URL: https://github.com/apache/shardingsphere/issues/30305

   ## Feature Request
   
   ### Is your feature request related to a problem?
   
https://github.com/apache/shardingsphere/issues?q=is%3Aopen+is%3Aissue+label%3A%22in%3A+SQL+parse%22+label%3A%22db%3A+SQLServer%22
   
   ### Describe the feature you would like.
   ShardingSphere currently unable to parse the edge constraint clauses in SQL 
Server.
   I am planning to enhance the support for SQL Server SQL parsing in 
ShardingSphere.
   
   The syntax of match in SQLServer is as follows [EDGE 
CONSTRAINT](https://learn.microsoft.com/zh-cn/sql/relational-databases/tables/graph-edge-constraints?view=sql-server-ver16#edge-constraint-clauses)
   
   ```
   CONSTRAINT constraint_name CONNECTION (cause1[, clause2...])
   ```
   
   The following shows the steps required to complete the task:
   
   Adjust antlr g4 file
   Adjust sqlServer visitor
   After completion, the following sql parsing is supported
   
   case1
   ```sql
   CREATE TABLE bought
      (
         PurchaseCount INT
            ,CONSTRAINT EC_BOUGHT CONNECTION (Customer TO Product) ON DELETE NO 
ACTION
      )
      AS EDGE;
   ```
   
[link](https://learn.microsoft.com/zh-cn/sql/relational-databases/tables/graph-edge-constraints?view=sql-server-ver16#edge-constraint-clauses)
   
   case2
   ```sql
   ALTER TABLE bought ADD CONSTRAINT EC_BOUGHT1 CONNECTION (Customer TO 
Product, Supplier TO Product);
   ```
   
[link](https://learn.microsoft.com/zh-cn/sql/relational-databases/tables/graph-edge-constraints?view=sql-server-ver16#edge-constraint-clauses)
   
   case3
   ```sql
   ALTER TABLE bought
   DROP CONSTRAINT EC_BOUGHT;
   ```
   
[link](https://learn.microsoft.com/zh-cn/sql/relational-databases/tables/graph-edge-constraints?view=sql-server-ver16#edge-constraint-clauses)
   


-- 
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.

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to