Skip to content

Latest commit

 

History

History
122 lines (90 loc) · 4.18 KB

File metadata and controls

122 lines (90 loc) · 4.18 KB

Java SQL Parser Library

.. toctree::
   :maxdepth: 2
   :hidden:

   usage
   contribution
   migration47
   migration50
   SQL Grammar Stable <syntax_stable>
   SQL Grammar Snapshot <syntax_snapshot>
   Unsupported Grammar <unsupported>
   Java API Stable <javadoc_stable>
   Java API Snapshot <javadoc_snapshot>
   keywords
   changelog

GitGub Release Badge GitGub Issues Badge Maven Badge CI Status Coverage Status Codacy Status Java Docs

A huge thank you to our sponsor, Starlake.ai who simplifies data ingestion, transformation, and orchestration, enabling faster delivery of high-quality data. Starlake has been instrumental in providing Piped SQL and numerous test cases for BigQuery, Redshift, DataBricks, and DuckDB. Show your support for ongoing development by visiting Starlake.ai and giving us a star!

JSQLParser is a SQL statement parser built from JavaCC. It translates SQLs in a traversable hierarchy of Java classes. Since the 5.0 release JSQLParser depends on Java 11 and has introduced new Visitors. Please see the :ref:`Migration to 5.0` guide.

Latest stable release: |JSQLPARSER_STABLE_VERSION_LINK|

Development version: |JSQLPARSER_SNAPSHOT_VERSION_LINK|

Java API Website

_images/JavaAST.png
SELECT /*+ PARALLEL */
    cfe.id_collateral_ref.nextval
    , id_collateral
FROM (  SELECT DISTINCT
            a.id_collateral
        FROM cfe.collateral a
            LEFT JOIN cfe.collateral_ref b
                ON a.id_collateral = b.id_collateral
        WHERE b.id_collateral_ref IS NULL )
;

SQL Dialects

JSqlParser is RDBMS agnostic and provides support for many dialects such as:

  • Oracle Database
  • MS SqlServer
  • MySQL and MariaDB
  • PostgreSQL
  • H2
  • DuckDB
  • Google BigQuery
  • Amazon Redshift
  • DataBricks
  • Snowflake

Features

  • 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
  • Old Oracle JOIN (+)
  • PostgreSQL implicit CAST ::
  • SQL Parameters (e.g. ? or :parameter)
  • Arrays vs. T-SQL Squared Bracket Quotes
  • Fluent API to create SQL Statements from java Code
  • Statement De-Parser to write SQL from Java Objects
  • Piped SQL (also known as FROM SQL)