JSqlParser VS antlr-tsql

Compare JSqlParser vs antlr-tsql and see what are their differences.

JSqlParser

JSqlParser parses an SQL statement and translate it into a hierarchy of Java classes. The generated hierarchy can be navigated using the Visitor Pattern (by JSQLParser)
Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
JSqlParser antlr-tsql
4 1
4,956 7
2.1% -
9.2 0.0
4 days ago over 4 years ago
Java ANTLR
Apache License 2.0 GNU Affero General Public License v3.0
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

JSqlParser

Posts with mentions or reviews of JSqlParser. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-07-29.
  • Semantic Diff for SQL
    7 projects | news.ycombinator.com | 29 Jul 2022
    I wonder if this is a topical thread to check if anyone is aware of a Java based solution to parse a CREATE VIEW statement to get a mapping between the view columns and the corresponding source table columns. I checked out jsqlparser[0] and it does produce an AST which can be parsed using the visitor-pattern[1] but was wondering if there is a more "out-of-the-box" solution. Due to various reasons, querying the database information schema is not an option I can pursue.

    [0]: https://github.com/JSQLParser/JSqlParser

    [1]: https://en.wikipedia.org/wiki/Visitor_pattern

  • Open Source SQL Parsers
    17 projects | dev.to | 8 Oct 2021
    JSQLParser can parse multiple SQL dialects like MySQL, Postgres and Oracle. The grammar can be modified to support other SQL dialects.
  • Let's write a compiler, part 5: A code generator
    14 projects | news.ycombinator.com | 19 Aug 2021
  • Racket v8.0
    7 projects | news.ycombinator.com | 14 Feb 2021
    Interesting coincidence - I'm working on a parser that parses the AST produced by JSqlParser[0] for a create view statement to generate mapping between the columns of a view and the columns of its underlying table. It is an interesting example of having to use the visitor pattern[1].

    [0]: https://github.com/JSQLParser/JSqlParser

antlr-tsql

Posts with mentions or reviews of antlr-tsql. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-02-14.
  • Racket v8.0
    7 projects | news.ycombinator.com | 14 Feb 2021
    I'm currently working on a TSQL parser in Racket because I want to do some code analysis on a few huge stored proc files (some of which are over 30k lines of code). I didn't want to use existing parsers because the trees they produce are monstrous [1,2]. Tried doing some fancy grep work, but it was giving me way too many false matches and wasn't as sound as I would have liked.

    I could use any language with reasonable parsing tools, but I like how flexible Racket is about it. Currently using megaparsack[3], but there are many different parsing tools available depending on your needs. Also, once you have done parsing, there are lots of convenient ways to manipulate the parse trees into whatever shape you need.

    I also think Racket has a lot of tooling that would make it great for large code bases.

    -It has great offline docs (scribble) which don't force you to use some comment based system like JavaDoc.

    -It has a very powerful and fast contract system that can be attached either at definition time like most languages or only at module boundaries.

    - While it has a macro system, it has a really good macro debugger (it lets you view how the code is iteratively expanded with options to show/hide the expansion of various macros). Since even non-hygienic macros deal with syntax objects and not just datums, macros don't even screw up error messages since line/column info is preserved!

    - You compile to executables unlike most scripting languages.

    - You can write some code with types and some with them, but unlike say TypeScript the boundary between typed and untyped code is sound since contracts are used to verify these boundaries.

    - A lot of the time you don't even need types because most names (i.e. variables and functions) are verified at compile time (to be more specific, at macro expansion time).

    - It has very aggressive sandboxing tools that let you control not only what names are visible to some untrusted code, but also control how much memory it uses without creating a new process.

    - Safer global variables in the form of parameterize. Very convenient for stuff like when you need to temporarily change the stdout for a single call.

    [1]: https://github.com/datacamp/antlr-tsql/blob/master/antlr_tsq...

What are some alternatives?

When comparing JSqlParser and antlr-tsql you can also consider the following projects:

Apache Calcite - Apache Calcite

racket - The Racket repository

sqlglot - Python SQL Parser and Transpiler

ActivityLog2 - Analyze data from swim, bike and run activities

zetasql - ZetaSQL - Analyzer Framework for SQL

megaparsack - Racket parser combinators inspired by parsack and megaparsec

sqlparse - A non-validating SQL parser module for Python

rhombus-brainstorming - Brainstorming and draft proposals for Rhombus [Moved to: https://github.com/racket/rhombus-prototype]

Presto - The official home of the Presto distributed SQL query engine for big data

imgmac

ANTLR - ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.

queryparser - Parsing and analysis of Vertica, Hive, and Presto SQL.