Skip to content

Commit ce21e8a

Browse files
committed
Merge origin/master
2 parents 39ec3c8 + 994e6c6 commit ce21e8a

File tree

231 files changed

+12279
-9492
lines changed

Some content is hidden

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

231 files changed

+12279
-9492
lines changed

.github/ISSUE_TEMPLATE/sql-parser-error.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ assignees: ''
77

88
---
99

10-
Always check against the **Latest SNAPSHOT of JSQLParser** and the [Syntax Diagram](https://jsqlparser.github.io/JSqlParser/syntax.html)
10+
Always check against the **Latest SNAPSHOT of JSQLParser** and the [Syntax Diagram](https://jsqlparser.github.io/JSqlParser/syntax_snapshot.html)
1111

1212
### Failing SQL Feature:
1313
- Brief description of the failing SQL feature
@@ -27,5 +27,5 @@ Always check against the **Latest SNAPSHOT of JSQLParser** and the [Syntax Diagr
2727

2828
### Tips:
2929
Please write in English and avoid Screenshots (as we can't copy and paste content from it).
30-
[Try your example online with the latest JSQLParser](http://217.160.215.75:8080/jsqlformatter/demo.html) and share the link in the error report.
30+
[Try your example online with the latest JSQLParser](http://jsqlformatter.manticore-projects.com) and share the link in the error report.
3131
Do provide Links or References to the specific Grammar and Syntax you are trying to use.

.github/workflows/gradle.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
6+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
7+
8+
name: Java CI with Gradle
9+
10+
on:
11+
push:
12+
branches: [ "master" ]
13+
pull_request:
14+
branches: [ "master" ]
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
build:
21+
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- uses: actions/checkout@v3
26+
- name: Set up JDK 11
27+
uses: actions/setup-java@v3
28+
with:
29+
java-version: '11'
30+
distribution: 'temurin'
31+
- name: Build with Gradle
32+
uses: gradle/gradle-build-action@v2
33+
with:
34+
arguments: build check
35+
# arguments: build check publish
36+
env:
37+
ossrhUsername: ${{ secrets.OSSRH_USERNAME }}
38+
ossrhPassword: ${{ secrets.OSSRH_TOKEN }}

.github/workflows/sphinx.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
name: Sphinx Pages
2-
on: [push, workflow_dispatch]
2+
on:
3+
push:
4+
branches: [ "master" ]
5+
pull_request:
6+
branches: [ "master" ]
7+
38
permissions: write-all
49
jobs:
510
docs:
@@ -9,7 +14,7 @@ jobs:
914
- name: Install XSLT Processor
1015
run: sudo apt-get install xsltproc sphinx-common
1116
- name: Install dependencies
12-
run: pip install sphinx_rtd_theme sphinx-book-theme myst_parser sphinx-prompt sphinx_substitution_extensions sphinx_issues sphinx_tabs pygments
17+
run: pip install furo myst_parser sphinx-prompt sphinx_substitution_extensions sphinx_issues sphinx_inline_tabs pygments
1318
- name: Checkout project sources
1419
uses: actions/checkout@v2
1520
with:
@@ -18,7 +23,7 @@ jobs:
1823
- name: Setup Gradle
1924
uses: gradle/gradle-build-action@v2
2025
- name: Run build with Gradle Wrapper
21-
run: gradle sphinx
26+
run: gradle --no-build-cache clean xmldoc sphinx
2227
- name: Deploy
2328
uses: actions/configure-pages@v2
2429
- name: Upload artifact

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
# Exclude the Auto-generated Changelog
99
/src/site/sphinx/changelog.rst
10+
/src/site/sphinx/javadoc_stable.rst
11+
/src/site/sphinx/syntax_stable.rst
1012

1113
# Generated by javacc-maven-plugin
1214
/bin
@@ -27,3 +29,5 @@
2729
/nbproject/
2830

2931
/.gradle
32+
/src/site/sphinx/javadoc_snapshot.rst
33+
/src/site/sphinx/syntax_snapshot.rst

README.md

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,35 @@ SELECT 1 FROM dual WHERE a = b
1818
```
1919

2020
```text
21-
SQL Text
22-
└─Statements: net.sf.jsqlparser.statement.select.PlainSelect
23-
├─selectItems -> Collection<SelectExpressionItem>
24-
│ └─selectItems: net.sf.jsqlparser.statement.select.SelectExpressionItem
25-
│ └─LongValue: 1
26-
├─Table: dual
27-
└─where: net.sf.jsqlparser.expression.operators.relational.EqualsTo
28-
├─Column: a
29-
└─Column: b
21+
SQL Text
22+
└─Statements: statement.select.PlainSelect
23+
├─selectItems: statement.select.SelectItem
24+
│ └─LongValue: 1
25+
├─Table: dual
26+
└─where: expression.operators.relational.EqualsTo
27+
├─Column: a
28+
└─Column: b
3029
```
3130

3231
```java
33-
Statement statement = CCJSqlParserUtil.parse(sqlStr);
34-
if (statement instanceof PlainSelect) {
35-
PlainSelect plainSelect = (PlainSelect) statement;
32+
String sqlStr = "select 1 from dual where a=b";
3633

37-
SelectExpressionItem selectExpressionItem =
38-
(SelectExpressionItem) plainSelect.getSelectItems().get(0);
34+
PlainSelect select = (PlainSelect) CCJSqlParserUtil.parse(sqlStr);
3935

40-
Table table = (Table) plainSelect.getFromItem();
36+
SelectItem selectItem =
37+
select.getSelectItems().get(0);
38+
Assertions.assertEquals(
39+
new LongValue(1)
40+
, selectItem.getExpression());
4141

42-
EqualsTo equalsTo = (EqualsTo) plainSelect.getWhere();
43-
Column a = (Column) equalsTo.getLeftExpression();
44-
Column b = (Column) equalsTo.getRightExpression();
42+
Table table = (Table) select.getFromItem();
43+
Assertions.assertEquals("dual", table.getName());
44+
45+
EqualsTo equalsTo = (EqualsTo) select.getWhere();
46+
Column a = (Column) equalsTo.getLeftExpression();
47+
Column b = (Column) equalsTo.getRightExpression();
48+
Assertions.assertEquals("a", a.getColumnName());
49+
Assertions.assertEquals("b", b.getColumnName());
4550
}
4651
```
4752

0 commit comments

Comments
 (0)