A Modern SQL frontend based on the SQL16 Standard with extensions for streaming, graph, rich types.
* Comprehensive support for statements:
- QUERY: ``SELECT ...``
- DML: ``INSERT ... INTO ...`` ``UPDATE ...`` ``MERGE ... INTO ...`` ``DELETE ... FROM ...``
- DDL: ``CREATE ...`` ``ALTER ...`` ``DROP ...``
* Nested Expressions (e.g. Sub-Selects)
* ``WITH`` clauses
* De-Parser for a Statement AST Node, which writes a SQL from Java Objects
* Rewriter
* Linter
-
Maven Repository
<dependency> <groupId>com.facebook.presto</groupId> <artifactId>presto-coresql</artifactId> <version>0.1</version> </dependency>
-
Parsing and Unparsing a SQL Statement
import com.facebook.coresql.parser.AstNode; import com.facebook.coresql.parser.ParserHelper; import com.facebook.coresql.parser.Unparser; String sqlStr = "select 1 from dual where a=b"; AstNode ast = ParserHelper.parseStatement(sqlStr); String unparsedSqlStr = Unparser.unparse(ast);
-
Compile latest version from source
git clone https://github.com/kaikalur/sql.git cd sql mvn install