Open Source SQL Parsers

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

Our great sponsors
  • Appwrite - The Open Source Firebase alternative introduces iOS support
  • InfluxDB - Access the most powerful time series database as a service
  • Sonar - Write Clean JavaScript Code. Always.
  • tree-sitter-sql

    SQL grammar for tree-sitter (by DerekStride)

    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

  • Appwrite

    Appwrite - The Open Source Firebase alternative introduces iOS support . Appwrite is an open source backend server that helps you build native iOS applications much faster with realtime APIs for authentication, databases, files storage, cloud functions and much more!

  • 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

  • lezer-snowsql

  • InfluxDB

    Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.

  • 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