{"id":41294,"library":"indexeddb-orm","title":"IndexedDB ORM","description":"A promise-based ORM wrapper for IndexedDB, providing a fluent query builder with support for model instances, relationships (hasOne, hasMany), indexing, aggregations, and transactional actions. Current stable version 2.1.0 (legacy branch) while v4.0.0-alpha.3 is under development. Key differentiator is a full ORM layer with relations and custom classes, unlike simpler wrappers like Dexie.js which focus on queries. Ships TypeScript types. Note: v4.0.0-alpha is unstable and has breaking changes from v2.1.0.","status":"active","version":"4.0.0-alpha.3","language":"javascript","source_language":"en","source_url":"https://github.com/maxgaurav/indexeddb-orm","tags":["javascript","indexeddb","indexed-db","browser","database","typescript"],"install":[{"cmd":"npm install indexeddb-orm","lang":"bash","label":"npm"},{"cmd":"yarn add indexeddb-orm","lang":"bash","label":"yarn"},{"cmd":"pnpm add indexeddb-orm","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"browser IndexedDB API is required, but used directly without polyfill","package":"indexeddb","optional":true}],"imports":[{"note":"Named export, not default. ESM only.","wrong":"import Connector from 'indexeddb-orm'","symbol":"Connector","correct":"import { Connector } from 'indexeddb-orm'"},{"note":"ESM syntax. CommonJS not officially supported but works with bundlers.","wrong":"const Model = require('indexeddb-orm').Model","symbol":"Model","correct":"import { Model } from 'indexeddb-orm'"},{"note":"Internal path not needed, main export re-exports it.","wrong":"import { QueryBuilder } from 'indexeddb-orm/dist/query-builder.js'","symbol":"QueryBuilder","correct":"import { QueryBuilder } from 'indexeddb-orm'"}],"quickstart":{"code":"import { Connector, Model } from 'indexeddb-orm';\n\nconst settings = {\n  name: 'myDatabase',\n  version: 1,\n  migrations: [\n    {\n      name: 'users',\n      primary: 'id',\n      autoIncrement: true,\n      indexes: [{ name: 'name' }]\n    }\n  ]\n};\n\nconst db = new Connector(settings);\n\nclass User extends Model {\n  static get tableName() {\n    return 'users';\n  }\n}\n\nconst run = async () => {\n  await db.connect();\n  const user = await User.create({ name: 'Alice' });\n  console.log(user);\n};\nrun();","lang":"typescript","description":"Connects to IndexedDB, defines a model, and inserts a record using the ORM."},"warnings":[{"fix":"Use v2.1.0 branch for stable ORM API. For v4-alpha, follow docs at maxgaurav.github.io/indexeddb-orm.","message":"v4.0.0-alpha changes import paths and API. v2.1.0 used different exports (e.g., 'idb' function).","severity":"breaking","affected_versions":">=4.0.0-alpha.1 <4.0.0"},{"fix":"Upgrade to v4-alpha for new features, beware breaking changes.","message":"v2.1.0 (older version) is maintained on a separate branch but no longer actively developed.","severity":"deprecated","affected_versions":"<=2.1.0"},{"fix":"Use only in browser or Web Workers. For Node, consider using fake-indexeddb or sqlite alternatives.","message":"IndexedDB is not available in Node.js; package only works in browser/Web Workers.","severity":"gotcha","affected_versions":"all"},{"fix":"Always await db.connect() before any CRUD.","message":"The Connector instance must be connected before using any Model operations. Forgetting await db.connect() throws 'Database not connected' error.","severity":"gotcha","affected_versions":">=4.0.0-alpha"},{"fix":"Use ES import syntax; if using require(), use dynamic import or bundler.","message":"v4.0.0-alpha drops CommonJS support; package is pure ESM.","severity":"breaking","affected_versions":">=4.0.0-alpha.1"}],"env_vars":null,"search_vec":"'2.1.0':32 'action':28 'aggreg':25 'base':6 'branch':34 'break':70 'browser':79 'builder':15 'chang':71 'class':51 'current':29 'custom':50 'databas':80 'db':78 'develop':39 'dexie.js':56 'differenti':41 'fluent':13 'focus':58 'full':44 'hasmani':23 'hason':22 'index':24,77 'indexed-db':76 'indexeddb':1,10,75 'instanc':20 'javascript':74 'key':40 'layer':46 'legaci':33 'like':55 'model':19 'note':64 'orm':2,7,45 'promis':5 'promise-bas':4 'provid':11 'queri':14,60 'relat':48 'relationship':21 'ship':61 'simpler':53 'stabl':30 'support':17 'transact':27 'type':63 'typescript':62,81 'unlik':52 'unstabl':67 'v2.1.0':73 'v4.0.0-alpha':65 'v4.0.0-alpha.3':36 'version':31 'wrapper':8,54","created_at":"2026-06-04T18:51:42.864428+00:00","updated_at":"2026-06-04T18:51:42.864428+00:00","problems":[{"fix":"Use named import: import { Connector } from 'indexeddb-orm'","cause":"Default import instead of named import: import Connector from 'indexeddb-orm'","error":"Uncaught TypeError: indexeddb_orm__WEBPACK_IMPORTED_MODULE_0__.Connector is not a constructor"},{"fix":"Add 'await db.connect();' before any Model operation","cause":"Calling query methods before awaiting db.connect()","error":"Cannot read properties of undefined (reading 'openRequest') at Connector.connect"},{"fix":"Ensure migration 'name' matches exactly with Model.tableName (case-sensitive)","cause":"Table name mismatch between migration definition and Model.tableName","error":"Uncaught (in promise) DOMException: Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found."},{"fix":"Provide the primary key value in the object passed to Model.create()","cause":"Primary key field missing in data when creating without autoIncrement","error":"Uncaught TypeError: Cannot read properties of undefined (reading 'id') at new ModelItem"}],"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/maxgaurav/indexeddb-orm#readme","github":"https://github.com/maxgaurav/indexeddb-orm","docs":null,"changelog":null,"pypi":null,"npm":"indexeddb-orm","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-04","next_check":"2026-09-02","install_tag":null}}