A Java SQL parser that translates SQL statements into a traversable hierarchy of Java classes, supporting multiple RDBMS dialects.
JSqlParser is a Java library that parses SQL statements and converts them into a traversable hierarchy of Java classes. It solves the problem of programmatically analyzing and manipulating SQL within Java applications by providing an abstract syntax tree representation. The library supports a wide range of SQL dialects from major relational databases.
Java developers who need to parse, analyze, or generate SQL statements programmatically, such as those building database tools, SQL linters, query builders, or data lineage analyzers.
Developers choose JSqlParser for its comprehensive SQL dialect support, active performance optimization, and the ability to navigate and manipulate SQL via a clean Java object model using the Visitor Pattern.
JSqlParser parses an SQL statement and translate it into a hierarchy of Java classes. The generated hierarchy can be navigated using the Visitor Pattern
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Handles SQL from over 10 RDBMS including PostgreSQL, MySQL, Oracle, and newer systems like BigQuery and DuckDB, as detailed in the supported grammar table.
Continuously benchmarked with JMH; version 5.3 shows a 10x speed improvement over version 5.2, with ongoing refactoring for massive performance boosts.
Provides a full abstract syntax tree using the Visitor Pattern, enabling programmatic analysis and manipulation of SQL statements, as illustrated in the code samples.
Uniquely parses the newer 'FROM-first' pipe syntax used by BigQuery and DuckDB, a feature highlighted in the documentation with specific examples.
Version 5.2 had a significant performance regression due to a specific commit, indicating potential quality control issues in releases that users must monitor.
Major upgrades like version 5.0 introduced breaking changes to AST Visitors, forcing migration efforts and code adjustments for existing users.
Requires JDK11 or higher, with version 5.1+ needing JDK17 for building, creating barriers for legacy Java environments stuck on older versions.