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 2021/08/17 09:57:58 UTC

[GitHub] [shardingsphere] hsw409328 opened a new issue #11862: how statement to sql(string)?

hsw409328 opened a new issue #11862:
URL: https://github.com/apache/shardingsphere/issues/11862


   ## Question
   
   **For English only**, other languages will not accept.
   
   use sql-parse-engine 
   
   
   `public static SQLStatement statement(final String databaseType, final String sql, final Boolean useCache) {
           ParseTree tree = new SQLParserEngine(databaseType).parse(sql, useCache);
           SQLVisitorEngine sqlVisitorEngine = new SQLVisitorEngine(databaseType, "STATEMENT", new Properties());
           SQLStatement sqlStatement = sqlVisitorEngine.visit(tree);
           return sqlStatement;
       }`
   
   How to convert an object to an executed SQL string?
     
   


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



[GitHub] [shardingsphere] tristaZero commented on issue #11862: how statement to sql(string)?

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #11862:
URL: https://github.com/apache/shardingsphere/issues/11862#issuecomment-906264995


   Hi @hsw409328 Thanks for your reply. If you want to do some changes on the SQL for your scenarios, sorry ShardingSphere parser can not help users convert SQLStatement to SQL. But if you want to implement it in ShardingSphere community, we are willing to provide our assistance to you. ;-)


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



[GitHub] [shardingsphere] hsw409328 commented on issue #11862: how statement to sql(string)?

Posted by GitBox <gi...@apache.org>.
hsw409328 commented on issue #11862:
URL: https://github.com/apache/shardingsphere/issues/11862#issuecomment-900310207


   unparse engine not found!


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



[GitHub] [shardingsphere] tristaZero commented on issue #11862: how statement to sql(string)?

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #11862:
URL: https://github.com/apache/shardingsphere/issues/11862#issuecomment-904477955


   Hi @hsw409328 
   Supposing the public API, the answer is yes. Currently, we do not provide an independent API to revert an SQLStatement to a SQL, while we implement it internally.
   Why do you want this feature?


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



[GitHub] [shardingsphere] sandynz closed issue #11862: how statement to sql(string)?

Posted by GitBox <gi...@apache.org>.
sandynz closed issue #11862:
URL: https://github.com/apache/shardingsphere/issues/11862


   


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



[GitHub] [shardingsphere] hsw409328 commented on issue #11862: how statement to sql(string)?

Posted by GitBox <gi...@apache.org>.
hsw409328 commented on issue #11862:
URL: https://github.com/apache/shardingsphere/issues/11862#issuecomment-901681465


   > Hi @hsw409328 Sorry I can not catch you.
   > Do you want to convert an SQLStatement into a rewritten SQL? Could I get the necessity? ShardingSphere will generate the to-execute by router and rewriter, which is a little complex.
   
   (sql-parse-engin) don't support SQLStatement to SQL ? Is that so?


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



[GitHub] [shardingsphere] tristaZero commented on issue #11862: how statement to sql(string)?

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #11862:
URL: https://github.com/apache/shardingsphere/issues/11862#issuecomment-901638022


   Hi @hsw409328 Sorry I can not catch you.
   Do you want to convert an SQLStatement into a rewritten SQL? Could I get the necessity? ShardingSphere will generate the to-execute by router and rewriter, which is a little complex.


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



[GitHub] [shardingsphere] strongduanmu commented on issue #11862: how statement to sql(string)?

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #11862:
URL: https://github.com/apache/shardingsphere/issues/11862#issuecomment-900170323


   @hsw409328 The original SQL is String type. Why convert the parsed result into String?


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



[GitHub] [shardingsphere] hsw409328 commented on issue #11862: how statement to sql(string)?

Posted by GitBox <gi...@apache.org>.
hsw409328 commented on issue #11862:
URL: https://github.com/apache/shardingsphere/issues/11862#issuecomment-900232695


   > @hsw409328 The original SQL is String type. Why convert the parsed result into String?
   
   I used the parsing engine alone to rewrite the where condition. I want to parse the changed object back to SQL string


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



[GitHub] [shardingsphere] hsw409328 commented on issue #11862: how statement to sql(string)?

Posted by GitBox <gi...@apache.org>.
hsw409328 commented on issue #11862:
URL: https://github.com/apache/shardingsphere/issues/11862#issuecomment-904479645


   > Hi @hsw409328
   > Supposing the public API, the answer is yes. Currently, we do not provide an independent API to revert an SQLStatement to a SQL, while we implement it internally.
   > Why do you want this feature?
   
   When I make a MySQL query, I automatically add conditions in the where part. I need to parse the original SQL, assemble it with SQLStatement, and finally restore it to executable SQL


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