A TypeScript MySQL query analyzer that detects syntax errors, validates table/column names against a provided schema, performs type checking, and offers optimization suggestions like missing indexes. Currently at version 0.3.0, it uses the companion package ts-mysql-schema to extract schema information from a live MySQL database. Supports custom parser options (e.g., MySQL version, character sets) and multiple statements. Differentiates itself from generic SQL parsers by providing actionable feedback tied to an actual database schema, making it useful for development and CI environments to catch SQL issues early.
npm install ts-mysql-analyzerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes a MySQLAnalyzer with a schema fetched from a database and analyzes a simple SELECT query.
Ensure you create a MySQLSchema instance and pass its getSchema() result to MySQLAnalyzer.
npm install ts-mysql-schema