A JavaScript library for parsing and stringifying SQL SELECT statements into ASTs, based on MySQL 5.7 SELECT grammar. Version 1.6.0 is current; last updated in 2021 with low release cadence. Supports basic SELECT syntax including joins, subqueries, and placeholders like ${param}. Does not support INSERT, UPDATE, DELETE, or DDL. Provides CommonJS, AMD, and browser builds. Key differentiator: minimal and focused solely on SELECT parsing vs full SQL parsers like sql.js or node-sql-parser.
npm install js-sql-parserNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Parse a SELECT query into an AST, modify it, and stringify back to SQL.
Update code to use 'reference' instead of 'refrence' when accessing AST node properties.
Use placeholders only for values (e.g., WHERE id = ${val}), not for schema object names.Run 'npm install js-sql-parser' and ensure node_modules contains it.
Use default import: import parser from 'js-sql-parser' then parser.stringify(ast).
No dependency data recorded yet.