sql-crafter is a TypeScript library for parsing, formatting, and transforming SQL queries. Currently at version 0.9.1, it is in early development (WIP). It provides structured parsing of SQL statements along with formatting and transformation utilities, inspired by dt-sql-parser. The library ships TypeScript types and is designed for Node.js environments. Key differentiators include a modular architecture separating parser, formatter, and transformer concerns, and a focus on extensibility. However, due to its early stage, APIs may change, and documentation is minimal.
npm install sql-crafterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Parses, formats, and transforms a simple SELECT SQL query using the three main exports.
Pin exact version and review changelog before upgrading.
Wrap parse calls in try/catch.
Review formatted output for important formatting.
Check SQL syntax and ensure it is supported by the parser.
Provide a rule object like { where: (node) => { ... } }.No dependency data recorded yet.