A JavaScript library for performing SQL-like queries (SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, JOIN) directly on arrays of objects, without requiring a database or schema. Current stable version is 3.0.1. Release cadence is irregular. Key differentiators: uses functions instead of strings/objects for queries, dependency-free (<8KB gzipped), works in browser, supports custom scalar functions and user-defined predicates. Not suitable for big data, complex queries (subqueries, set operations), or complex data types (only number and string).
npm install sql-selectNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic SELECT with aggregate functions (SUM, AVG), WHERE filter, GROUP BY, and ORDER BY on an array of objects.
Change SELECT(['col1', 'col2'], ...) to SELECT('col1', 'col2', ...).Ensure FROM(input) is placed inside the SELECT() call, not used separately.
Use AS('alias') as shown in docs; watch for updates.Use uppercase function names: SELECT, FROM, WHERE, GROUP_BY, ORDER_BY, etc.
Use import syntax or configure your project for ESM. If using Node.js, set 'type': 'module' in package.json.
Ensure the predicate explicitly returns true/false.
Import SELECT as { SELECT } from 'sql-select' and use uppercase.Place FROM, WHERE, etc. inside the SELECT() function call.
Ensure FROM() receives an array of objects.
Run 'npm install sql-select' and use import { SELECT } from 'sql-select'.Pass a predicate function like row => row.age > 18.