You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/01/29 07:46:44 UTC

[GitHub] [shardingsphere] tuichenchuxin commented on a change in pull request #15154: Support config encrypt column data type

tuichenchuxin commented on a change in pull request #15154:
URL: https://github.com/apache/shardingsphere/pull/15154#discussion_r795019938



##########
File path: shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/EncryptAlterTableTokenGenerator.java
##########
@@ -122,6 +126,17 @@ public boolean isGenerateSQLToken(final SQLStatementContext sqlStatementContext)
     
     private Collection<SQLToken> getAddColumnTokens(final String tableName, final String columnName,
                                                     final AddColumnDefinitionSegment addColumnDefinitionSegment, final ColumnDefinitionSegment columnDefinitionSegment) {
+        return containsConfigDataType(tableName, columnName) ? getAddColumnTokensWithConfigDataType(tableName, columnName, addColumnDefinitionSegment, columnDefinitionSegment) 
+                : getAddColumnTokensByDefault(tableName, columnName, addColumnDefinitionSegment, columnDefinitionSegment);
+    }
+    
+    private boolean containsConfigDataType(final String tableName, final String columnName) {

Review comment:
       > @tuichenchuxin Can we move this method to EncryptRule? I think this logic is common, it may be used by other class.
   
   Nice suggestion, Done.




-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org