Parse SQL SELECT statements into an abstract syntax tree (AST) and convert ASTs back to SQL. Current stable version is 1.2.13. Released as needed. Key differentiator: lightweight, focused only on SELECT statements, with AST-to-SQL conversion. It is a fork of the original cht-ui-sql-parser, maintained under the floral-sql-parser npm name. Supports Node >=10 with CommonJS only (no ESM).
npm install floral-sql-parserNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Parses a SELECT statement into an AST and converts the AST back to the original SQL.
Ensure input SQL is a SELECT statement.
Pin the package version and do not rely on internal AST node shapes across updates.
Use require() or use a dynamic import wrapper (if using ESM).
Update package.json dependency to 'floral-sql-parser'.
Only pass SELECT statements to parse().
Use const { parse } = require('floral-sql-parser').No dependency data recorded yet.