A SQL parser and stringifier specifically for Apache Druid SQL syntax, version 1.2.7. It produces an AST (Abstract Syntax Tree) from Druid SQL queries and can serialize ASTs back to SQL strings. The library is lightweight with no dependencies, focusing on Druid-specific SQL features such as double-quoted identifiers and system tables like sys.server_segments. It is not a general SQL parser; it does not support all SQL dialects nor standard SQL fully. The package is stable with infrequent releases, last updated in early 2022. Differentiators: zero dependencies, simple API (parse and stringify), Druid-specific syntax support.
npm install druid-sql-parserNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Parses a Druid SQL query into an AST, then converts the AST back to SQL string.
Use a more comprehensive SQL parser if you need general SQL support.
Ensure identifiers are properly double-quoted; escape internal double quotes by doubling them.
Check for newer versions or fork the repository for updates.
Use named exports: import { parse, stringify } from 'druid-sql-parser'.Use import parser from 'druid-sql-parser' and then parser.parse(sql).
Ensure the input is a valid Druid SQL string.
Only use SELECT queries with this parser.
No dependency data recorded yet.