A nearley-based SQL parser and analyzer for JavaScript. Current version 0.2.9 is in early development (work in progress) with support for SELECT and CREATE VIEW operations. Outputs structured analysis including referenced tables, created tables, source tables from subqueries/joins, and the parse tree. Differentiators: lightweight, no external database required, focuses on SQL analysis rather than execution. Release cadence: irregular maintenance updates.
npm install js-sql-parseNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Parses a SQL SELECT query with a JOIN and logs the analyzed properties: operation, referenced tables, source tables, and joins.
Check the operation field after parsing. For unsupported operations, consider a different SQL parser.
Pin to a specific version and test thoroughly before upgrading.
Inspect the `parsed` field (the Nearley parse tree) for full details.
Use `import parser from 'js-sql-parse'` or `const parser = require('js-sql-parse')`.Simplify the query to standard SQL; avoid dialect-specific keywords and operators.