{"id":15019626,"url":"https://github.com/jsqlparser/jsqlparser","last_synced_at":"2025-09-09T20:36:55.654Z","repository":{"id":37335678,"uuid":"1944709","full_name":"JSQLParser/JSqlParser","owner":"JSQLParser","description":"JSqlParser parses an SQL statement and translate it into a hierarchy of Java classes. The generated hierarchy can be navigated using the Visitor Pattern","archived":false,"fork":false,"pushed_at":"2025-05-05T11:55:58.000Z","size":13114,"stargazers_count":5665,"open_issues_count":89,"forks_count":1386,"subscribers_count":217,"default_branch":"master","last_synced_at":"2025-05-05T14:53:55.775Z","etag":null,"topics":["ast","hierarchy","java","jsqlparser","mysql","oracle","parser","paypal","postgresql","sql","sql-statement","sqlserver","statement"],"latest_commit_sha":null,"homepage":"https://github.com/JSQLParser/JSqlParser/wiki","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JSQLParser.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE_APACHEV2","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://paypal.me/wumpz"}},"created_at":"2011-06-23T22:51:52.000Z","updated_at":"2025-05-04T22:21:42.000Z","dependencies_parsed_at":"2024-05-19T11:39:19.466Z","dependency_job_id":"9bf137be-656c-4b0b-a2fd-9703edacbb17","html_url":"https://github.com/JSQLParser/JSqlParser","commit_stats":{"total_commits":1621,"total_committers":131,"mean_commits":"12.374045801526718","dds":"0.23318938926588528","last_synced_commit":"0e9833328d01a315951e75058786660633b0953c"},"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JSQLParser%2FJSqlParser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JSQLParser%2FJSqlParser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JSQLParser%2FJSqlParser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JSQLParser%2FJSqlParser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JSQLParser","download_url":"https://codeload.github.com/JSQLParser/JSqlParser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253777154,"owners_count":21962635,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ast","hierarchy","java","jsqlparser","mysql","oracle","parser","paypal","postgresql","sql","sql-statement","sqlserver","statement"],"created_at":"2024-09-24T19:53:48.311Z","updated_at":"2025-09-09T20:36:55.634Z","avatar_url":"https://github.com/JSQLParser.png","language":"Java","readme":"# [JSqlParser 5.3 Website](https://jsqlparser.github.io/JSqlParser) \u003cimg src=\"src/site/sphinx/_images/logo-no-background.svg\" alt=\"drawing\" width=\"200\" align=\"right\"/\u003e\n\n[![CI](https://github.com/JSQLParser/JSqlParser/actions/workflows/ci.yml/badge.svg)](https://github.com/JSQLParser/JSqlParser/actions/workflows/ci.yml)\n[![Coverage Status](https://coveralls.io/repos/JSQLParser/JSqlParser/badge.svg?branch=master)](https://coveralls.io/r/JSQLParser/JSqlParser?branch=master)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/6f9a2d7eb98f45969749e101322634a1)](https://www.codacy.com/gh/JSQLParser/JSqlParser/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=JSQLParser/JSqlParser\u0026amp;utm_campaign=Badge_Grade)\n[![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)\n[![Gitter](https://badges.gitter.im/JSQLParser/JSqlParser.svg)](https://gitter.im/JSQLParser/JSqlParser?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n\nA 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!\n\n## Summary\n\nPlease 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)):\n\n```sql\nSELECT 1 FROM dual WHERE a = b\n\n/* produces the following AST\n\nSQL Text\n └─Statements: statement.select.PlainSelect\n    ├─selectItems: statement.select.SelectItem\n    │  └─LongValue: 1\n    ├─Table: dual\n    └─where: expression.operators.relational.EqualsTo\n       ├─Column: a\n       └─Column: b\n*/\n```\n\n```java\nString sqlStr = \"select 1 from dual where a=b\";\n\nPlainSelect select = (PlainSelect) CCJSqlParserUtil.parse(sqlStr);\n\nSelectItem selectItem =\n        select.getSelectItems().get(0);\nAssertions.assertEquals(\n        new LongValue(1)\n        , selectItem.getExpression());\n\nTable table = (Table) select.getFromItem();\nAssertions.assertEquals(\"dual\", table.getName());\n\nEqualsTo equalsTo = (EqualsTo) select.getWhere();\nColumn a = (Column) equalsTo.getLeftExpression();\nColumn b = (Column) equalsTo.getRightExpression();\nAssertions.assertEquals(\"a\", a.getColumnName());\nAssertions.assertEquals(\"b\", b.getColumnName());\n```\n## Support for `Piped SQL`\n\nWork is progressing for parsing `Piped SQL`, a much saner and more logical way to write queries in its semantic order.\n```sql\nFROM Produce\n|\u003e WHERE\n    item != 'bananas'\n    AND category IN ('fruit', 'nut')\n|\u003e AGGREGATE COUNT(*) AS num_items, SUM(sales) AS total_sales\n   GROUP BY item\n|\u003e ORDER BY item DESC;\n```\n\nFor 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\n\n## Java Version\n\nJSQLParser-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.\n\nBuilding JSQLParser-5.1 and newer with Gradle will depend on a JDK17 toolchain due to the used plugins.\n\nJSQLParser-5.4 Snapshot and later use JavaCC-8 Snapshots for generating the parser.\n\n## Performance\n\nUnfortunately the released JSQLParser-5.2 shows a performance deterioration caused by commit [30cf5d7](https://github.com/JSQLParser/JSqlParser/commit/30cf5d7b930ae0a076f49deb5cc841d39e62b3dc) related to `FunctionAllColumns()`.\nThis has been resolved in JSQLParser 5.3-SNAPSHOT and JMH benchmarks have been added to avoid such regressions in the future. Further all `LOOKAHEAD` have been revised one by one, and we have gained back a very good performance of the Parser.\n\n```text\nBenchmark                               (version)  Mode  Cnt   Score   Error  Units\nJSQLParserBenchmark.parseSQLStatements     latest  avgt   15  82.695 ± 2.841  ms/op\nJSQLParserBenchmark.parseSQLStatements        5.3  avgt   15  84.687 ± 3.321  ms/op\nJSQLParserBenchmark.parseSQLStatements        5.1  avgt   15  86.592 ± 5.781  ms/op\n```\n\n## [Supported Grammar and Syntax](https://jsqlparser.github.io/JSqlParser/syntax.html)\n\n**JSqlParser** aims to support the SQL standard as well as all major RDBMS. Any missing syntax or features can be added on demand.\n\n| RDBMS                                                                                                           | Statements                                                                                                                              |\n|-----------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|\n| Oracle\u003cbr\u003eMS SQL Server and Sybase\u003cbr\u003ePostgres\u003cbr\u003eMySQL and MariaDB\u003cbr\u003eDB2\u003cbr\u003eH2 and HSQLDB and Derby\u003cbr\u003eSQLite | `SELECT`\u003cbr\u003e`INSERT`, `UPDATE`, `UPSERT`, `MERGE`\u003cbr\u003e`DELETE`, `TRUNCATE TABLE`\u003cbr\u003e`CREATE ...`, `ALTER ....`, `DROP ...`\u003cbr\u003e`WITH ...` |\n| Salesforce SOQL                                                                                                 | `INCLUDES`, `EXCLUDES`                                                                                                                  |\n| Piped SQL (also known as FROM SQL)                                                                              |                                                                                                                                         |\n\n**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)).\n\n## Sister Projects\n\nIf you like JSqlParser then please check out its related projects:\n\n* [JSQLFormatter](https://manticore-projects.com/JSQLFormatter/index.html) for pretty printing and formatting SQL Text\n\n* [JSQLTranspiler](https://manticore-projects.com/JSQLTranspiler/index.html) for dialect specific rewriting, SQL Column resolution and Lineage, provided by [Starlake.ai](https://starlake.ai/)\n\n## Alternatives to JSqlParser?\n[**General SQL Parser**](http://www.sqlparser.com/features/introduce.php?utm_source=github-jsqlparser\u0026utm_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.\n\nAlternatively 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.\n\n## [Documentation](https://jsqlparser.github.io/JSqlParser)\n  1. [Samples](https://jsqlparser.github.io/JSqlParser/usage.html#parse-a-sql-statements)\n  2. [Build Instructions](https://jsqlparser.github.io/JSqlParser/usage.html) and [Maven Artifact](https://jsqlparser.github.io/JSqlParser/usage.html#build-dependencies)\n  3. [Contribution](https://jsqlparser.github.io/JSqlParser/contribution.html)\n  4. [Change Log](https://jsqlparser.github.io/JSqlParser/changelog.html#latest-changes-since-jsqlparser-version)\n  5. [Issues](https://github.com/JSQLParser/JSqlParser/issues)\n\n## License\n\n**JSqlParser** is dual licensed under **LGPL V2.1** or **Apache Software License, Version 2.0**.\n","funding_links":["https://paypal.me/wumpz"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsqlparser%2Fjsqlparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsqlparser%2Fjsqlparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsqlparser%2Fjsqlparser/lists"}