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 2020/10/21 07:53:41 UTC

[GitHub] [shardingsphere] tristaZero opened a new issue #7869: New SQLASTParserEngine is pubic for user to parse your SQLs

tristaZero opened a new issue #7869:
URL: https://github.com/apache/shardingsphere/issues/7869


   Hi community,
   
   I am glad to announce that ShardingSphere will provide an independent SQL parser engine for parsing SQLs!
   I believe you will have some of the scenarios or use the SQL parser engine to get a parsed AST. From now on, you will have another option for your cases. Here are some of the advantages for ShardingSphere parser engine.
   
   ### Advantages
   1. Mostly perfect SQL statements supported for MySQL database
   2. Mostly perfect SQL statements supported  for PostgreSQL database
   3. Basically SQL statements supported  for SQLServer database
   4. Basically SQL statements supported  for Oracle database
   5. SQL parsed result cache for the parsing performance
   6. AST parsed result and SQLStatement parsed result are provided meanwhile
   7. Simple extension approach for SQLStatement visitors
   8. Simple supplement approach and for SQL definition 
   9. Continuous improvement for the much better feature in the future.
   
   5.x release will include this one, please wait for our good news!


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu closed issue #7869: New independent SQLParserEngine is going online to parse SQL for different database dialects

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


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero edited a comment on issue #7869: New independent SQLParserEngine is going online to parse SQL for different database dialects

Posted by GitBox <gi...@apache.org>.
tristaZero edited a comment on issue #7869:
URL: https://github.com/apache/shardingsphere/issues/7869#issuecomment-720315491


   Hi,
   
   Thanks for everyone's feedback and opinions!
   Given the comments here, it looks that the second one is the most expectation. Hence, the following API is our final choice!
   ```java
   public static void main(String[] args) {
       String dbType = "MySQL";
       String visitorType = "SQLStatement";
       boolean useCache = true;
       
       String sql1 = "select * from tb1";
       String sql2 = "select * from tb2";
   
       // Way2
       SQLParserEngine parser = new SQLParserEngine(dbType);
       SQLVisitorEngine visitor = new SQLVisitorEngine(dbType,  visitorType);
       
       SQLStatement result1 = visitor.visit(parser.parse(sql1,  useCache));
       SQLStatement result2 = visitor.visit(parser.parse(sql2,  useCache));
   }
   ```
   I will finish this modification ASAP and re-prepare our incoming 5.0.0-alpha release. Please wait for my updates.
   
   Best,
   Trista


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] yangtaihsou commented on issue #7869: New SQLASTParserEngine is pubic for user to parse your SQLs soon

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


   I claim this issue.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] yangtaihsou removed a comment on issue #7869: New SQLASTParserEngine is pubic for user to parse your SQLs soon

Posted by GitBox <gi...@apache.org>.
yangtaihsou removed a comment on issue #7869:
URL: https://github.com/apache/shardingsphere/issues/7869#issuecomment-714357779


   I claim this issue.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on issue #7869: New independent SQLParserEngine is going online to parse SQL for different database dialects

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


   Hi,
   Thanks for everyone's feedback and opinions!
   Given the comments here, it looks that the second one is the most expectation. Hence, the following API is our final choice!
   
   ```java
   public static void main(String[] args) {
       String dbType = "MySQL";
       String visitorType = "SQLStatement";
       boolean useCache = true;
       
       String sql1 = "select * from tb1";
       String sql2 = "select * from tb2";
   
       // Way2
       SQLParserEngine parser = new SQLParserEngine(dbType);
       SQLVisitorEngine visitor = new SQLVisitorEngine(dbType,  visitorType);
       
       SQLStatement result1 = visitor.visit(parser.parse(sql1,  useCache));
       SQLStatement result2 = visitor.visit(parser.parse(sql2,  useCache));
   }
   ```
   
   I will finish this modification ASAP and re-prepare our incoming 5.0.0-alpha release. Please wait for my updates.
   
   Best,
   Trista


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] khalidcawl commented on issue #7869: New SQLASTParserEngine is pubic for user to parse your SQLs soon

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


   Hi @tristaZero. I came across this comment (and this repository) just now while searching for a SQL-92 parser. Is it supported in the SQLASTParserEngine? My use case is very simple: 
   Input: SQL-92 compliant SQL
   output: extract Tables and Columns in the SQL
   
   I would appreciate if you could point me to where I could get started. 
   Thanks in advance.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on issue #7869: New SQLASTParserEngine is pubic for user to parse your SQLs soon

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


   Hi @khalidcawl Sorry for my late reply.
   
   Thanks for your remainder. The answer is YES. As I mentioned in this issue, `Basically SQL statements supported for SQL92` is in this release range. But I suggest you'd better give it a test. :)
   And we will provide the detailed instruction later. If you can not wait to use, packaging the master branch is needed for you.
   
   Best,
   Trista


----------------------------------------------------------------
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:
users@infra.apache.org