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

   ## 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.
   
   Through the efforts of many developers in the community, ShardingSphere's 
support for SQLServer DML syntax is constantly improving. I think it's time to 
go a step further, and on top of SQL parsing, we can use encrypt feature and 
test SQLServer DML statements. 
   
   When we test SQLServer DML encryption, there will be some problems, it may 
be SQL parsing problems, it may be encryption rewriting problems, and it may 
even be SQL Binder problems. What we have to do is find these problems and fix 
them.
   
   The following shows the steps required to complete the task:
   
   1. Install SQLServer 2017 on your machine, please refer to 
https://hub.docker.com/_/microsoft-mssql-server;
   2. Then config encrypt rule like following:
   
   ```yaml
   databaseName: encrypt_db
   
   dataSources:
     db0:
       dataSourceClassName: com.zaxxer.hikari.HikariDataSource
       driverClassName: com.microsoft.sqlserver
       jdbcUrl: 
jdbc:sqlserver://db1.database.windows.net;databaseName=db1;loginTimeout=300;encrypt=false;
       username: adm
   
   rules:
   - !SINGLE
     tables:
       - "*.*"
   - !ENCRYPT
     encryptors:
       aes_encryptor:
         type: AES
         props:
           aes-key-value: 123456abc
       like_encryptor:
         type: IT.ENCRYPT.LIKE.FIXTURE
         props:
           mask: 4093
     tables:
       t_user:
         columns:
           user_name:
             cipher:
               name: user_name_cipher
               encryptorName: aes_encryptor
             likeQuery:
               name: user_name_like
               encryptorName: like_encryptor
           password:
             cipher:
               name: password_cipher
               encryptorName: aes_encryptor
           email:
             cipher:
               name: email_cipher
               encryptorName: aes_encryptor
           telephone:
             cipher:
               name: user_telephone_cipher
               encryptorName: aes_encryptor
             likeQuery:
               name: user_telephone_like
               encryptorName: like_encryptor
       t_merchant:
         columns:
           business_code:
             cipher:
               name: business_code_cipher
               encryptorName: aes_encryptor
             likeQuery:
               name: business_code_like
               encryptorName: like_encryptor
           telephone:
             cipher:
               name: merchant_telephone_cipher
               encryptorName: aes_encryptor
             likeQuery:
               name: merchant_telephone_like
               encryptorName: like_encryptor
   ```
   
   3. Init encrypt table - 
https://github.com/apache/shardingsphere/blob/d39f46b5bf420d14c39523c34303ac0c95205d4d/test/e2e/sql/src/test/resources/env/scenario/encrypt/data/actual/init-sql/mysql/01-actual-init.sql
   4. Write unit test to test SQLServer DML statement, you can refer - 
ShardingSphereDriverTest
   5. 
   
   
   
   


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