Skip to content

Commit 431a046

Browse files
author
Stefan Steinhauser
committed
Merge branch 'master' into feature/exasol-import-statement
2 parents f495c96 + b366f2b commit 431a046

File tree

114 files changed

+3512
-1293
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+3512
-1293
lines changed

.github/workflows/ci.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: CI Pipeline
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
workflow_dispatch:
9+
10+
permissions: write-all
11+
12+
jobs:
13+
gradle_check:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@main
17+
with:
18+
fetch-depth: 0
19+
- name: Set up JDK 11
20+
uses: actions/setup-java@main
21+
with:
22+
java-version: '11'
23+
distribution: 'temurin'
24+
- name: Build with Gradle
25+
uses: gradle/actions/setup-gradle@main
26+
- name: Run Gradle Check
27+
run: ./gradlew check
28+
29+
maven_verify:
30+
needs: gradle_check
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@main
34+
with:
35+
fetch-depth: 0
36+
- name: Set up JDK 11
37+
uses: actions/setup-java@main
38+
with:
39+
java-version: '11'
40+
distribution: 'temurin'
41+
cache: maven
42+
server-id: sonatype-nexus-snapshots
43+
server-username: MAVEN_USERNAME
44+
server-password: MAVEN_PASSWORD
45+
- name: Build with Maven
46+
run: mvn -X -B verify --file pom.xml -DdisableXmlReport=true -Djacoco.skip=true -Dpmd.skip=true
47+
env:
48+
MAVEN_USERNAME: ${{ secrets.OSSRHUSERNAME }}
49+
MAVEN_PASSWORD: ${{ secrets.OSSRHPASSWORD }}
50+
51+
gradle_publish:
52+
needs: maven_verify
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@main
56+
with:
57+
fetch-depth: 0
58+
- name: Set up JDK 11
59+
uses: actions/setup-java@main
60+
with:
61+
java-version: '11'
62+
distribution: 'temurin'
63+
- name: Build with Gradle
64+
uses: gradle/actions/setup-gradle@main
65+
- name: Publish with Gradle
66+
run: ./gradlew publish
67+
env:
68+
ossrhUsername: ${{ secrets.OSSRHUSERNAME }}
69+
ossrhPassword: ${{ secrets.OSSRHPASSWORD }}
70+
- uses: actions/setup-python@main
71+
- name: Install XSLT Processor
72+
run: sudo apt-get install xsltproc sphinx-common
73+
- name: Install Python dependencies
74+
run: pip install furo myst_parser sphinx-prompt sphinx_substitution_extensions sphinx_issues sphinx_inline_tabs pygments
75+
- name: Build Sphinx documentation with Gradle
76+
run: FLOATING_TOC=false ./gradlew -DFLOATING_TOC=false gitChangelogTask renderRR xslt xmldoc sphinx
77+
- name: Deploy Sphinx documentation
78+
uses: actions/configure-pages@main
79+
- name: Upload artifact
80+
uses: actions/upload-pages-artifact@main
81+
with:
82+
path: 'build/sphinx'
83+
- name: Deploy to GitHub Pages
84+
id: deployment
85+
uses: actions/deploy-pages@main

.github/workflows/gradle.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/gradle_publish.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/workflows/maven.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/maven_deploy.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/sphinx.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

README.md

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
1-
# [JSqlParser 5.0 Website](https://jsqlparser.github.io/JSqlParser) <img src="src/site/sphinx/_images/logo-no-background.svg" alt="drawing" width="200" align="right"/>
1+
# [JSqlParser 5.1 Website](https://jsqlparser.github.io/JSqlParser) <img src="src/site/sphinx/_images/logo-no-background.svg" alt="drawing" width="200" align="right"/>
22

3-
[![Maven deploy snapshot](https://github.com/JSQLParser/JSqlParser/actions/workflows/maven_deploy.yml/badge.svg)](https://github.com/JSQLParser/JSqlParser/actions/workflows/maven_deploy.yml)
4-
[![Gradle CI](https://github.com/JSQLParser/JSqlParser/actions/workflows/gradle.yml/badge.svg)](https://github.com/JSQLParser/JSqlParser/actions/workflows/gradle.yml)
5-
[![Coverage Status](https://coveralls.io/repos/JSQLParser/JSqlParser/badge.svg?branch=master)](https://coveralls.io/r/JSQLParser/JSqlParser?branch=master)
3+
[![CI](https://github.com/JSQLParser/JSqlParser/actions/workflows/ci.yml/badge.svg)](https://github.com/JSQLParser/JSqlParser/actions/workflows/ci.yml)
4+
[![Coverage Status](https://coveralls.io/repos/JSQLParser/JSqlParser/badge.svg?branch=master)](https://coveralls.io/r/JSQLParser/JSqlParser?branch=master)
65
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/6f9a2d7eb98f45969749e101322634a1)](https://www.codacy.com/gh/JSQLParser/JSqlParser/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=JSQLParser/JSqlParser&amp;utm_campaign=Badge_Grade)
76
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.jsqlparser/jsqlparser/badge.svg)](http://maven-badges.herokuapp.com/maven-central/com.github.jsqlparser/jsqlparser) [![Javadocs](https://www.javadoc.io/badge/com.github.jsqlparser/jsqlparser.svg)](https://www.javadoc.io/doc/com.github.jsqlparser/jsqlparser)
87
[![Gitter](https://badges.gitter.im/JSQLParser/JSqlParser.svg)](https://gitter.im/JSQLParser/JSqlParser?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
98

9+
A huge thank you to our sponsor, [Starlake.ai](https://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!
10+
1011
## Summary
1112

12-
Please visit the [WebSite](https://jsqlparser.github.io/JSqlParser). **JSqlParser** is a RDBMS agnostic SQL statement parser. It translates SQL statements into a traversable hierarchy of Java classes (see [Samples](https://jsqlparser.github.io/JSqlParser/usage.html#parse-a-sql-statements)):
13+
Please visit our [WebSite](https://jsqlparser.github.io/JSqlParser) for detailed information. **JSqlParser** is a RDBMS agnostic SQL statement parser. It translates SQL statements into a traversable hierarchy of Java classes (see [Samples](https://jsqlparser.github.io/JSqlParser/usage.html#parse-a-sql-statements)):
1314

1415
```sql
1516
SELECT 1 FROM dual WHERE a = b
16-
```
1717

18-
```text
18+
/* produces the following AST
19+
1920
SQL Text
2021
└─Statements: statement.select.PlainSelect
2122
├─selectItems: statement.select.SelectItem
@@ -24,6 +25,7 @@ SQL Text
2425
└─where: expression.operators.relational.EqualsTo
2526
├─Column: a
2627
└─Column: b
28+
*/
2729
```
2830

2931
```java
@@ -45,19 +47,35 @@ Column a = (Column) equalsTo.getLeftExpression();
4547
Column b = (Column) equalsTo.getRightExpression();
4648
Assertions.assertEquals("a", a.getColumnName());
4749
Assertions.assertEquals("b", b.getColumnName());
48-
}
4950
```
51+
## Support for `Piped SQL`
52+
53+
Work is progressing for parsing `Piped SQL`, a much saner and more logical way to write queries in its semantic order.
54+
```sql
55+
FROM Produce
56+
|> WHERE
57+
item != 'bananas'
58+
AND category IN ('fruit', 'nut')
59+
|> AGGREGATE COUNT(*) AS num_items, SUM(sales) AS total_sales
60+
GROUP BY item
61+
|> ORDER BY item DESC;
62+
```
63+
64+
For details, please see https://storage.googleapis.com/gweb-research2023-media/pubtools/1004848.pdf, https://cloud.google.com/bigquery/docs/reference/standard-sql/pipe-syntax and https://duckdb.org/docs/sql/query_syntax/from.html#from-first-syntax
65+
66+
## Java Version
5067

51-
JSQLParser-4.9 was the last JDK8 compatible version. The recent JSQLParser-5.0 depends on JDK11 and introduces API breaking changes to the AST Visitors. Please see the Migration Guide for the details.
68+
JSQLParser-4.9 was the last JDK8 compatible version. JSQLParser-5.0 and later depend on JDK11 and introduce API breaking changes to the AST Visitors. Please see the Migration Guide for the details.
5269

5370
## [Supported Grammar and Syntax](https://jsqlparser.github.io/JSqlParser/syntax.html)
5471

5572
**JSqlParser** aims to support the SQL standard as well as all major RDBMS. Any missing syntax or features can be added on demand.
5673

57-
| RDBMS | Statements |
58-
|-----------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|
59-
| Oracle<br>MS SQL Server and Sybase<br>Postgres<br>MySQL and MariaDB<br>DB2<br>H2 and HSQLDB and Derby<br>SQLite | `SELECT`<br>`INSERT`, `UPDATE`, `UPSERT`, `MERGE`<br>`DELETE`, `TRUNCATE TABLE`<br>`CREATE ...`, `ALTER ....`, `DROP ...`<br>`WITH ...` |
60-
| Salesforce SOQL | `INCLUDES`, `EXCLUDES` |
74+
| RDBMS | Statements |
75+
|-----------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|
76+
| Oracle<br>MS SQL Server and Sybase<br>Postgres<br>MySQL and MariaDB<br>DB2<br>H2 and HSQLDB and Derby<br>SQLite | `SELECT`<br>`INSERT`, `UPDATE`, `UPSERT`, `MERGE`<br>`DELETE`, `TRUNCATE TABLE`<br>`CREATE ...`, `ALTER ....`, `DROP ...`<br>`WITH ...` |
77+
| Salesforce SOQL | `INCLUDES`, `EXCLUDES` |
78+
| Piped SQL (also known as FROM SQL) | |
6179

6280
**JSqlParser** can also be used to create SQL Statements from Java Code with a fluent API (see [Samples](https://jsqlparser.github.io/JSqlParser/usage.html#build-a-sql-statements)).
6381

@@ -67,12 +85,12 @@ If you like JSqlParser then please check out its related projects:
6785

6886
* [JSQLFormatter](https://manticore-projects.com/JSQLFormatter/index.html) for pretty printing and formatting SQL Text
6987

70-
* [JSQLTranspiler](https://manticore-projects.com/JSQLTranspiler/index.html) for dialect specific rewriting, SQL Column resolution and Lineage
88+
* [JSQLTranspiler](https://manticore-projects.com/JSQLTranspiler/index.html) for dialect specific rewriting, SQL Column resolution and Lineage, provided by [Starlake.ai](https://starlake.ai/)
7189

7290
## Alternatives to JSqlParser?
7391
[**General SQL Parser**](http://www.sqlparser.com/features/introduce.php?utm_source=github-jsqlparser&utm_medium=text-general) looks pretty good, with extended SQL syntax (like PL/SQL and T-SQL) and java + .NET APIs. The tool is commercial (license available online), with a free download option.
7492

75-
Alternatively the dual-licensed [JOOQ](https://www.jooq.org/doc/latest/manual/sql-building/sql-parser/) provides a hand-written Parser supporting a lot of RDBMS, translation between dialects, SQL transformation, can be used as a JDBC proxy for translation and transformation purposes.
93+
Alternatively the dual-licensed [JOOQ](https://www.jooq.org/doc/latest/manual/sql-building/sql-parser/) provides a handwritten Parser supporting a lot of RDBMS, translation between dialects, SQL transformation, can be used as a JDBC proxy for translation and transformation purposes.
7694

7795
## [Documentation](https://jsqlparser.github.io/JSqlParser)
7896
1. [Samples](https://jsqlparser.github.io/JSqlParser/usage.html#parse-a-sql-statements)

0 commit comments

Comments
 (0)