Open Source SQL Parsers

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • tree-sitter-sql

    SQL grammar for tree-sitter

    I'm using a tree-sitter grammar^1, which category the OP doesn't mention, to index database object references in data access code and process schema migrations^2. The idea is early detection of potentially-dangerous database changes that modify or drop tables/views still used elsewhere, across the entire organization's code. It's already saved my bacon a few times.

    ^1 specifically https://github.com/DerekStride/tree-sitter-sql , but there are a few others around too

  • duckdb

    DuckDB is an in-process SQL OLAP Database Management System

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

  • prql

    PRQL is a modern language for transforming data — a simple, powerful, pipelined SQL replacement

    Then limit

    The order of operations are out of whack and makes pipeline ing a little hard.

    I found this to be closer to LINQ way

    https://github.com/prql/prql

    I hope in near future databases will come with better query languages...

  • hasql-th

    Template Haskell utilities for Hasql

    There is also a Haskell port of the original PostgreSQL parser, implemented using megaparsec, which makes it highly flexible and hackable: https://github.com/nikita-volkov/hasql-th#implementation

  • grammars-v4

    Grammars written for ANTLR v4; expectation that the grammars are free of actions.

    I believe antlr has grammars for other sql syntaxes (sqlite, tsql, etc): https://github.com/antlr/grammars-v4/tree/master/sql

  • tree-sitter-sql

    SQL syntax highlighting for tree-sitter (by m-novikov)

  • lezer-snowsql

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

  • sqlschm

    A SQLite Schema Parser

    SQL is a mess. It is difficult to find a parser that fulfills your needs.

    A month ago, I needed a parser to parse SQLite schemas. SQLite has some edge case and I needed a lossless parsing to detect these edge cases.

    I finally wrote my own parser [1] to fullfill my needs and to have some fun. This is for a POC project.

    [1] https://github.com/coast-team/sqlschm

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts