High-level SQL parser that extracts tables, columns, aliases, and more from SQL scripts into an easy-to-consume object. Currently at version 1.4.1, actively maintained on GitHub with regular releases. Supports PostgreSQL, MySQL, SQL Server, and Oracle dialects (PL/pgSQL, T-SQL, PL/SQL). Unlike low-level parsers that return parse trees, SQL Surveyor provides a structured object with output columns, referenced columns, referenced tables, and tokens, making analysis straightforward. Includes TypeScript type definitions. Zero configuration required.
npm install sql-surveyorNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage: import, instantiate with dialect, parse a SQL query, and access the first parsed query.
Check the documentation for known limitations. For unsupported features, consider using a lower-level parser like node-sql-parser.
Ensure your SQL identifiers are consistently cased in the input.
When using token locations, remember that line numbers start at 1, while character indices start at 0.
Run 'npm install sql-surveyor'. If using TypeScript, ensure 'node_modules/@types' is in typeRoots or the package ships types (it does).
Change import to 'import { SQLSurveyor } from 'sql-surveyor';'No dependency data recorded yet.