TypeScript-first, isomorphic database abstraction supporting multiple backends (IndexedDB via Dexie, SQLite/libSQL, MongoDB, JSONL). v2.0.2 is current stable. Schema-driven table definition with auto-indexing, unified CRUD, and a provider-agnostic aggregation pipeline (joins, grouping, sorting). Differentiators: single API across browser and Node.js, built-in upsert, unique indexes, and no ORM overhead. Monthly releases. Ships types. ESM-only, requires Node >=18.17.1.
npm install defuss-dbNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Declares a User table with a unique email index, connects to Dexie (IndexedDB), inserts a record, and finds it by email.
Import providers from 'defuss-db/client.js' (DexieProvider) or 'defuss-db/server.js' (LibsqlProvider, MongoProvider, JsonlProvider) instead of using deprecated defaults.
Use createAggregation({ table: myTable, as: 'alias' }) instead of myTable.aggregate() if you need a custom alias. If not, myTable.aggregate() still works but defaults to 'base'.Use `new DexieProvider(new Dexie('AppDatabase'))` or provide an options object: `new DexieProvider({ database: 'AppDatabase' })`.Always write `interface User extends DefussRecord { ... }`.Use import syntax. If you need CommonJS, upgrade to Node 22+ and use dynamic import().
Ensure defuss-db >=2.0.0 is installed. In tsconfig.json, set "moduleResolution": "node16" or "bundler". If using an older version, upgrade: `npm install defuss-db@latest`.
Add `await users.init();` before any insert, find, update, or delete.
Ensure your entity interface extends DefussRecord: `interface User extends DefussRecord { ... }`Rename file to .mjs, or add `"type": "module"` to package.json.
No dependency data recorded yet.