{"id":43850,"library":"slimsql","title":"SlimSQL","description":"SlimSQL is a lightweight in-memory SQL query engine for JavaScript, version 1.0.15. It allows running SQL queries directly on JavaScript arrays by registering them as virtual tables. It supports SELECT, JOINs, window functions (e.g., RANK), WHERE, GROUP BY, ORDER BY, and aggregation. Different from libraries like alasql, SlimSQL is minimal (43KB gzipped) with no dependencies, TypeScript types included, and focuses on basic SQL for data exploration. Release cadence is moderate; last update May 2023. Works in Node.js and browsers (ESM/CJS/UMD).","status":"active","version":"1.0.15","language":"javascript","source_language":"en","source_url":"https://github.com/yangzhenzhuozz/slimsql","tags":["javascript","typescript"],"install":[{"cmd":"npm install slimsql","lang":"bash","label":"npm"},{"cmd":"yarn add slimsql","lang":"bash","label":"yarn"},{"cmd":"pnpm add slimsql","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM default; CJS require works but named import might fail in some bundlers; use default import for CJS.","wrong":"const { SQLSession } = require('slimsql')","symbol":"SQLSession","correct":"import { SQLSession } from 'slimsql'"},{"note":"Default export is the SQLSession class. CommonJS require gives an object with 'default' property in ESM interop.","wrong":"const slimsql = require('slimsql')","symbol":"SQLSession (default import)","correct":"import SQLSession from 'slimsql'"},{"note":"Types are exported but not runtime objects; only for TypeScript.","wrong":"const { TableRow } = require('slimsql')","symbol":"type TableRow or QueryResult","correct":"import type { TableRow, QueryResult } from 'slimsql'"}],"quickstart":{"code":"import { SQLSession } from 'slimsql';\n\nconst data = [\n  { id: 1, name: 'Alice', score: 10 },\n  { id: 2, name: 'Bob', score: 20 },\n];\n\nconst session = new SQLSession();\nsession.registTableView(data, 'users');\n\nconst result = session.sql('SELECT name, score FROM users WHERE score > 15');\nconsole.table(result.data);\n// Output: [{ name: 'Bob', score: 20 }]","lang":"typescript","description":"Demonstrates creating a SQLSession, registering a JavaScript array as a table, and querying with a basic SELECT with WHERE clause."},"warnings":[{"fix":"Ensure unique table names; use 'existsTableView' method to check.","message":"Table names must be strings; registration does not validate uniqueness. Overwriting an existing table silently replaces it.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use only supported SQL features; read docs for limitations.","message":"Window functions (RANK, DENSE_RANK, ROW_NUMBER) are supported but only PARTITION BY and ORDER BY; no frame clause (ROWS/RANGE).","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use IS NULL / IS NOT NULL explicitly.","message":"NULL handling may differ from SQL standard: comparisons like NULL = NULL return false, not NULL; IS NULL works correctly.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"For large datasets, consider chunking or offloading to Web Workers (browser).","message":"The 'sql' method is synchronous; does not support async/await. Long queries block the main thread.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.15':15 '2023':77 '43kb':54 'aggreg':45 'alasql':50 'allow':17 'array':24 'basic':65 'browser':82 'cadenc':71 'data':68 'depend':58 'differ':46 'direct':21 'e.g':37 'engin':11 'esm/cjs/umd':83 'explor':69 'focus':63 'function':36 'group':40 'gzip':55 'in-memori':6 'includ':61 'javascript':13,23,84 'join':34 'last':74 'librari':48 'lightweight':5 'like':49 'may':76 'memori':8 'minim':53 'moder':73 'node.js':80 'order':42 'queri':10,20 'rank':38 'regist':26 'releas':70 'run':18 'select':33 'slimsql':1,2,51 'sql':9,19,66 'support':32 'tabl':30 'type':60 'typescript':59,85 'updat':75 'version':14 'virtual':29 'window':35 'work':78","created_at":"2026-06-05T17:01:46.995582+00:00","updated_at":"2026-06-05T17:01:46.995582+00:00","problems":[{"fix":"Add 'type':'module' to package.json or use require('slimsql') with CJS.","cause":"Using ESM import in a CommonJS Node.js project without 'type':'module' in package.json.","error":"Cannot use import statement outside a module"},{"fix":"Use import { SQLSession } from 'slimsql' instead of require.","cause":"Using require in an ESM module; node expects import.","error":"require is not defined"},{"fix":"Method name is 'registTableView' (no 'er' after 'regist'). Use exact string: session.registTableView(...).","cause":"Typo: 'registTableView' is misspelled 'register' or 'registerTableView'.","error":"TypeError: session.registTableView is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/yangzhenzhuozz/slimsql#readme","github":"https://github.com/yangzhenzhuozz/slimsql","docs":null,"changelog":null,"pypi":null,"npm":"slimsql","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}