{"id":18167,"library":"blinkdb","title":"BlinkDB","description":"BlinkDB is an in-memory JavaScript database optimized for large-scale data on the client side. Current stable version is 0.14.0, released with a monthly cadence. It provides indexed queries, filtering, sorting, and pagination, serving as a high-performance alternative to Redux or MobX for SPAs. Key differentiator: database-like querying with an API inspired by Prisma, supporting both relational and non-relational data. Not yet production-ready (pre-1.0.0). Ships TypeScript types.","status":"active","version":"0.14.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","typescript"],"install":[{"cmd":"npm install blinkdb","lang":"bash","label":"npm"},{"cmd":"yarn add blinkdb","lang":"bash","label":"yarn"},{"cmd":"pnpm add blinkdb","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"BlinkDB is ESM-only; CommonJS require is not supported.","wrong":"const { many } = require('blinkdb')","symbol":"many","correct":"import { many } from 'blinkdb'"},{"note":"Named import, not default export.","wrong":"import first from 'blinkdb'","symbol":"first","correct":"import { first } from 'blinkdb'"},{"note":"The function is named createTable, not table.","wrong":"import { table } from 'blinkdb'","symbol":"createTable","correct":"import { createTable } from 'blinkdb'"},{"note":"Type-only class import; also available as a type for instance.","wrong":"import BlinkDB from 'blinkdb'","symbol":"BlinkDB","correct":"import { BlinkDB } from 'blinkdb'"},{"note":"Table is a type, not a value; use type import to avoid runtime inclusion.","wrong":"import { Table } from 'blinkdb'","symbol":"type Table","correct":"import type { Table } from 'blinkdb'"}],"quickstart":{"code":"import { createTable, many, insert, BlinkDB } from 'blinkdb';\n\nconst db = new BlinkDB();\nconst usersTable = createTable<User>(db, 'users')();\n\ninterface User {\n  id: number;\n  name: string;\n  age: number;\n}\n\nawait insert(usersTable, {\n  id: 1, name: 'Alice', age: 30,\n  id: 2, name: 'Bob', age: 25,\n  id: 3, name: 'Charlie', age: 35\n});\n\nconst result = await many(usersTable, {\n  where: {\n    age: { gt: 24 }\n  },\n  sort: { age: 'asc' },\n  limit: 10\n});\n\nconsole.log(result);","lang":"typescript","description":"Creates a table, inserts records, queries with filter, sort, and limit using BlinkDB."},"warnings":[{"fix":"Use createTable<T>(db, name)() with double parentheses or pass options as second argument.","message":"Breaking change in v0.13.0: createTable no longer returns Table directly, but a function that must be called.","severity":"breaking","affected_versions":">=0.13.0"},{"fix":"Replace update with upsert to update or insert a record.","message":"Deprecated in v0.13.0: The 'update' function is deprecated in favor of 'upsert'.","severity":"deprecated","affected_versions":">=0.13.0"},{"fix":"Use import type { Table } from 'blinkdb' for type-only imports.","message":"TypeScript: The 'Table' type is not exported as a value; attempting to import { Table } at runtime will be undefined.","severity":"gotcha","affected_versions":">=0.14.0"},{"fix":"Always await query results or use .then().","message":"All query functions (many, first, insert, etc.) are async and return Promises.","severity":"gotcha","affected_versions":">=0.10.0"},{"fix":"Use many instead of query.","message":"Deprecated in v0.11.0: 'query' function replaced by 'many' for consistency.","severity":"deprecated","affected_versions":">=0.11.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use import { createTable } from 'blinkdb' (named import).","cause":"Using named import from default export; likely import createTable from 'blinkdb' instead of named import.","error":"TypeError: (0 , blinkdb_1.createTable) is not a function"},{"fix":"Run 'npm install blinkdb' and ensure project is configured for ESM (use --type module in package.json or .mjs extension).","cause":"Package not installed or module system mismatch.","error":"Cannot find module 'blinkdb'"},{"fix":"Use import { BlinkDB } from 'blinkdb'.","cause":"Importing class as default instead of named.","error":"Error: BlinkDB is not a constructor"},{"fix":"Ensure table is created with an index on the 'name' field: createTable<User>(db, 'users')({ primary: 'id', indexes: ['name'] })","cause":"Using the 'in' operator is only supported in TypeScript with specific index types.","error":"Property 'in' does not exist on type 'WhereClause'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}