sql-summary (v1.0.1) is a lightweight JavaScript library that analyzes any SQL query and produces a concise summary string containing the main verb (SELECT, INSERT, UPDATE, etc.), the type of object operated on (TABLE, DATABASE, etc.), and the primary table or database name. It is maintained by Elastic and is ideal for logging, monitoring, and grouping similar queries without revealing sensitive details. It has minimal dependencies and is compatible with Node.js and browsers. Release cadence is low; the package is stable and receives updates for bug fixes.
npm install sql-summaryNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage: passing SQL queries to sqlSummary and printing the summarized output.
Ensure the argument is a string: sqlSummary(String(query))
Test with your specific SQL patterns; the summary is best-effort.
Create a .d.ts file: declare module 'sql-summary' { function sqlSummary(query: string): string; export = sqlSummary; }Use the CommonJS require: const sqlSummary = require('sql-summary');Run npm install sql-summary and ensure node_modules contains it.
No dependency data recorded yet.