Open yangzhongke opened 5 years ago
Druid SQLPaser: https://github.com/alibaba/druid/wiki/SQL-Parser
代码在编译时报错
This project employs ANTLR to compile the grammar definition files sqlparser.g and sqltreeparser.g (under the folder com\cownew\cownewsql\ast\grammar) into SQLTreeParser.java, SQLLexer.java and other files. So this project depends on antlr and antlr studio, which is an Eclipse plugin. Please install antlr studio plugin(https://www.antlr.org/tools.html) on your Eclipse.
Can I develop with idea?
On the page I mentioned, there is a 'Intellij Plugin for ANTLR 4', please check that page.
Hi , I am using the plugin to compile the sqltreeparser.g file and found that I can't use the plugin to compile. Considering that it may be a version problem, the file suffix is changed to sqltreeparser.g4, which can be compiled, but the following error is reported . Please take a look,thank you very much !
Hi , I am using the plugin to compile the sqltreeparser.g file and found that I can't use the plugin to compile. Considering that it may be a version problem, the file suffix is changed to sqltreeparser.g4, which can be compiled, but the following error is reported . Please take a look,thank you very much
I am sorry, the project was developed ten years ago, and the grammar files were developed by another guy who has not been as a developer for ages. So you should try to solve this problem by yourself.
This is the build version, you can use it in your project directly.
I used this version at the beginning, but one problem is that t. cannot be recognized when I convert (select t., a.id from table a left join tables t on...)
I used this version at the beginning, but one problem is that t. cannot be recognized when I convert (select t., a.id from table a left join tables t on...)
I am sorry, but I'm not deep into Antlr, so I couldn't help you. You should try to learn Antlr and fix bugs by yourself. Welcome to pull request.
ok,thank you very much!
有没有考虑调整成maven项目或者gradle
有没有考虑调整成maven项目或者gradle
Sorry, this is a legacy project., so I have no plan to maintain it. If I would rewrite it using Druid, I will use maven to organise this project
OK Thanks!
CownewSQL was launched in 2006, which is a SQL dialect translator. It can translate SQL into different SQL dialects on different DBMS. It consists of two parts: SQLParser and SQLTranslator. The development of SQLParser requires lots of knowledge on the Compiler Principle, but I just taught myself about Compiler Principle, so I don't have the ability to build an SQLParser. The SQLParser of CowNewSQL was developed by King Chou, who is one of the open-source team members. What I do is to translate the AST into SQL dialect. I found an open-soure SQLParser: Druid, which is developed by WenShao. I am considering to replace the SQLParser in CownewSQL with that of Druid. If you are interested in CowNewSQL, please let me know.