Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Database Tools
  3. JSqlParser

JSqlParser

Apache-2.0Javajsqlparser-5.4

A Java SQL parser that translates SQL statements into a traversable hierarchy of Java classes, supporting multiple RDBMS dialects.

Visit WebsiteGitHubGitHub
6.0k stars1.4k forks0 contributors

What is JSqlParser?

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.

Target Audience

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.

Value Proposition

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.

Overview

JSqlParser parses an SQL statement and translate it into a hierarchy of Java classes. The generated hierarchy can be navigated using the Visitor Pattern

Use Cases

Best For

  • Building SQL query builders or ORM tools in Java
  • Analyzing SQL for security auditing or linting
  • Implementing SQL dialect translation or transpilation
  • Extracting metadata or lineage from SQL statements
  • Programmatically modifying SQL queries in Java applications
  • Parsing non-standard SQL extensions like Piped SQL

Not Ideal For

  • Applications requiring real-time, high-throughput SQL parsing with strict sub-millisecond latency per query
  • Projects deeply integrated with a single database's proprietary features needing semantic validation beyond syntax
  • Teams seeking a simple, drop-in SQL manipulation API without dealing with AST navigation or Visitor Pattern complexity

Pros & Cons

Pros

Multi-Dialect Support

Handles SQL from over 10 RDBMS including PostgreSQL, MySQL, Oracle, and newer systems like BigQuery and DuckDB, as detailed in the supported grammar table.

Performance Optimized

Continuously benchmarked with JMH; version 5.3 shows a 10x speed improvement over version 5.2, with ongoing refactoring for massive performance boosts.

Comprehensive AST Navigation

Provides a full abstract syntax tree using the Visitor Pattern, enabling programmatic analysis and manipulation of SQL statements, as illustrated in the code samples.

Piped SQL Support

Uniquely parses the newer 'FROM-first' pipe syntax used by BigQuery and DuckDB, a feature highlighted in the documentation with specific examples.

Cons

Past Performance Instability

Version 5.2 had a significant performance regression due to a specific commit, indicating potential quality control issues in releases that users must monitor.

API Breaking Changes

Major upgrades like version 5.0 introduced breaking changes to AST Visitors, forcing migration efforts and code adjustments for existing users.

JDK Version Limitations

Requires JDK11 or higher, with version 5.1+ needing JDK17 for building, creating barriers for legacy Java environments stuck on older versions.

Frequently Asked Questions

Quick Stats

Stars5,966
Forks1,442
Contributors0
Open Issues6
Last commit1 day ago
CreatedSince 2011

Tags

#java-library#java#database-agnostic#sql-analysis#rdbms#postgresql#sqlserver#mysql#sql-parser#ast#abstract-syntax-tree#visitor-pattern#bigquery#parser#hierarchy#sql#sql-generation

Built With

J
JavaCC
J
Java
G
Gradle

Links & Resources

Website

Included in

Database Tools5.1k
Auto-fetched 1 day ago

Related Projects

SQLGlotSQLGlot

Python SQL Parser and Transpiler

Stars9,706
Forks1,349
Last commit1 day ago
jOOQjOOQ

jOOQ is the best way to write SQL in Java

Stars6,797
Forks1,217
Last commit1 day ago
sqlparsesqlparse

A non-validating SQL parser module for Python

Stars4,023
Forks773
Last commit2 months ago
libpg_querylibpg_query

C library for accessing the PostgreSQL parser outside of the server environment

Stars1,488
Forks232
Last commit3 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub