A SQL parser for Node.js that converts SQL statements into an abstract syntax tree (AST) and back. Version 1.8.31 supports SELECT, DELETE, UPDATE, INSERT, DROP, TRUNCATE, and RENAME commands. It can handle multiple SQL statements separated by semicolons and outputs tables and columns visited. Supports MySQL, PostgreSQL, Hive, MariaDB, and TransactSQL dialects. Ships with TypeScript definitions. The parser is designed for simple SQL parsing needs and allows opting into TypeScript types via definitely typed.
npm install lite-ui-sql-parserNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Parses a SQL SELECT statement into an AST, then converts it back to SQL string.
Check the supported features list. For unsupported syntax, consider using a more full-featured parser like sql.js or a database-specific parser.
Update imports and method calls according to the new API: `const { Parser } = require('node-sql-parser')` and use `astify`/`sqlify`.Inspect the AST by console logging it. File an issue if you need specific fields.
Replace `parser.parse(sql)` with `parser.astify(sql)`.
Test with your specific queries. If needed, preprocess the SQL to remove backticks.
Run `npm install node-sql-parser` and ensure the import is correct: `{ Parser } from 'node-sql-parser'`.Update to latest version: `npm install node-sql-parser@latest`. Use `const { Parser } = require('node-sql-parser')`.Simplify the query or use a different SQL parser that supports the feature.
Check the SQL for unsupported constructs. Use a try-catch around astify.
No dependency data recorded yet.