{"id":43999,"library":"squirreling","title":"Squirreling Async SQL Engine","description":"Squirreling (v0.12.23) is a streaming async SQL engine in pure JavaScript, designed for browser environments with zero dependencies. It supports standard SQL (read-only), pluggable data sources, lazy async cell evaluation, and async user-defined functions (UDFs). Key differentiators: cell-level lazy evaluation reduces unnecessary computation for network/LLM sources; true streaming via AsyncGenerators; 13 kB bundle size. Unlike WebAssembly databases, it is fully async and works where network latency matters. Ships TypeScript types.","status":"active","version":"0.12.23","language":"javascript","source_language":"en","source_url":"https://github.com/hyparam/squirreling","tags":["javascript","sql","data","dataset","hyperparam","hyparquet","parquet","query","relational","typescript"],"install":[{"cmd":"npm install squirreling","lang":"bash","label":"npm"},{"cmd":"yarn add squirreling","lang":"bash","label":"yarn"},{"cmd":"pnpm add squirreling","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only; CommonJS require will fail. Package is ESM with no CJS fallback.","wrong":"const { executeSql } = require('squirreling')","symbol":"executeSql","correct":"import { executeSql } from 'squirreling'"},{"note":"collect is a named export, not default. Both executeSql and collect are named.","wrong":"import collect from 'squirreling'","symbol":"collect","correct":"import { collect } from 'squirreling'"},{"note":"QueryResults is a TypeScript interface, not a runtime value. Use type import to avoid bundler issues.","wrong":"import { QueryResults } from 'squirreling'","symbol":"QueryResults","correct":"import type { QueryResults } from 'squirreling'"},{"note":"AsyncRow is a TypeScript type/interface; cannot import at runtime.","wrong":"const AsyncRow = require('squirreling').AsyncRow","symbol":"AsyncRow","correct":"import type { AsyncRow } from 'squirreling'"}],"quickstart":{"code":"import { executeSql, collect } from 'squirreling';\n\nconst users = [\n  { id: 1, name: 'Alice', active: true },\n  { id: 2, name: 'Bob', active: false },\n  { id: 3, name: 'Charlie', active: true },\n];\n\nasync function main() {\n  const result = await collect(executeSql({\n    tables: { users },\n    query: 'SELECT * FROM users WHERE active = true',\n  }));\n  console.log(result);\n  // [ { id: 1, name: 'Alice', active: true }, { id: 3, name: 'Charlie', active: true } ]\n}\n\nmain().catch(console.error);","lang":"typescript","description":"Shows basic usage: execute SQL on an in-memory array, collect all rows into an array, and filter with WHERE."},"warnings":[{"fix":"Use ES module imports (import) or dynamic import() in CommonJS files. Alternatively, set \"type\": \"module\" in package.json.","message":"ESM-only package: using require() will throw 'ERR_REQUIRE_ESM'. Must use import syntax.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Use type-only imports: import type { QueryResults } from 'squirreling'.","message":"TypeScript types are shipped but are strict: interfaces like QueryResults, AsyncRow are not runtime values. Attempting to use them as objects will fail.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Always await cell functions: const val = await cells.id(). Use helper collect() to materialize all cells.","message":"Lazy evaluation: cells are async thunks; calling cells.id() without await returns a Promise, not the value. Forgetting await will lead to Promise objects in output.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Only use SELECT queries. For mutations, handle them outside Squirreling.","message":"Read-only queries: SQL DELETE, UPDATE, INSERT are not supported. Using them will throw an error.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Upgrade to >=0.12.0; the library now validates table formats.","message":"The tables option expects objects; passing an array instead of a named object may cause a Silent failure in older versions.","severity":"deprecated","affected_versions":"<0.12.0"}],"env_vars":null,"search_vec":"'13':61 'async':2,10,34,38,71 'asyncgener':60 'browser':18 'bundl':63 'cell':35,47 'cell-level':46 'comput':53 'data':31,83 'databas':67 'dataset':84 'defin':41 'depend':22 'design':16 'differenti':45 'engin':4,12 'environ':19 'evalu':36,50 'fulli':70 'function':42 'hyparquet':86 'hyperparam':85 'javascript':15,81 'kb':62 'key':44 'latenc':76 'lazi':33,49 'level':48 'matter':77 'network':75 'network/llm':55 'parquet':87 'pluggabl':30 'pure':14 'queri':88 'read':28 'read-on':27 'reduc':51 'relat':89 'ship':78 'size':64 'sourc':32,56 'sql':3,11,26,82 'squirrel':1,5 'standard':25 'stream':9,58 'support':24 'true':57 'type':80 'typescript':79,90 'udf':43 'unlik':65 'unnecessari':52 'user':40 'user-defin':39 'v0.12.23':6 'via':59 'webassembl':66 'work':73 'zero':21","created_at":"2026-06-05T17:02:29.640329+00:00","updated_at":"2026-06-05T17:02:29.640329+00:00","problems":[{"fix":"Run npm install squirreling and ensure your project uses ESM (type: module in package.json or .mjs extension).","cause":"Missing dependency or incorrect package.json configuration (e.g., no type: module).","error":"Error: Cannot find module 'squirreling'"},{"fix":"Switch to ES module import: import { executeSql } from 'squirreling'.","cause":"Using CommonJS require which returns an ESM module that does not export via module.exports.","error":"TypeError: executeSql is not a function"},{"fix":"Use await cells.id() instead of cells.id. Cells are functions returning promises.","cause":"Accessing cells[column] directly instead of calling it as a function.","error":"TypeError: cells.id is not a function"},{"fix":"Only SELECT queries are supported. Remove mutation statements.","cause":"Attempting to run a non-SELECT query (INSERT, UPDATE, DELETE).","error":"Error: SQL syntax error at line 1: DELETE not allowed"}],"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://hyperparam.app","github":"https://github.com/hyparam/squirreling","docs":null,"changelog":null,"pypi":null,"npm":"squirreling","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","search"],"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}}