sql-tools provides OLAP functionality (cube, rollup) for SQL engines that lack native OLAP support, transforming standard SQL queries into aggregated result sets. Version 0.1.7 is a pre-1.0 release (stability: designing) with irregular release cadence. Its key differentiator is generating SQL that works on any database without requiring OLAP extensions, unlike dedicated OLAP libraries. Includes additional SQL utility functions.
npm install sql-toolsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage of olap.cube to generate an aggregated SQL with totals for a given grouping column.
Pin to exact version and monitor releases for breaking changes.
Ensure all varsDef objects have 'name' and 'place' fields; 'aggLabel' is required for 'left' fields.
Use ESM import syntax.
Use import { olap } from 'sql-tools' or const olap = require('sql-tools').olap.Run npm install sql-tools and ensure the import is correct.
Check database compatibility; use a database that supports WITH (CTE) syntax.
No dependency data recorded yet.