`sql-parse` is an unmaintained JavaScript utility for parsing basic SQL queries, with its last known stable version being 0.1.5, published in June 2015. It was designed to provide a simple programmatic interface for tokenizing and parsing SQL strings, extracting components like `SELECT` statements and `WHERE` clauses, including initial support for `OR` operators. Due to its age and lack of maintenance for nearly a decade, it is considered abandoned. Modern SQL dialects, advanced query features, and contemporary JavaScript module systems (ESM) are not supported. Developers seeking robust, actively maintained SQL parsing solutions for diverse database systems (e.g., MySQL, PostgreSQL, BigQuery, Snowflake, FlinkSQL) should consider alternatives like `node-sql-parser`, `dt-sql-parser`, or `@casual-simulation/sql-parser`. Its release cadence was sporadic and ceased many years ago. It lacks official TypeScript types and has no external runtime dependencies.
npm install sql-parseVerified import paths — ran on the pinned version, not inferred.
Demonstrates importing and using the `parse` function to process a basic SQL `SELECT` statement in a CommonJS environment. It also highlights potential issues with unsupported syntax due to the package's age.
Migrate your application to a actively maintained and modern SQL parsing library, such as `node-sql-parser`, `dt-sql-parser`, `@casual-simulation/sql-parser`, or `js-sql-parser`.
Ensure all imports for this package use `const { parse } = require('sql-parse');` syntax within a CommonJS environment. For projects primarily using ESM, a full migration to a modern parser is recommended.Thoroughly test the parser with your specific SQL queries. For comprehensive and dialect-specific SQL parsing, switch to a more actively developed library that explicitly supports various SQL dialects.
If migration is not immediately feasible, create a custom `sql-parse.d.ts` file with basic type declarations. However, the recommended solution is to migrate to a modern SQL parser that provides built-in TypeScript support.
Change the import statement to `const { parse } = require('sql-parse');`.Ensure you are using CommonJS `require` syntax: `const { parse } = require('sql-parse');`. Verify that `sql-parse` is installed and the path is correct.Review the problematic SQL statement for advanced features or dialect-specific syntax. If the query is complex or uses modern SQL, consider migrating to a more robust and actively maintained SQL parser.
No dependency data recorded yet.