Changelog for @signaldb/indexeddb
BREAKING CHANGES
- Switched to new
StorageAdapterAPI. - One database now holds every collection, and the adapter is configured accordingly.
createIndexedDBAdapter('posts')used to open a database of its own per collection (signaldb-posts, single storeitems). It now takes a description of one database —databaseName,versionand aschemamapping each store name to the fields to index — and returns thestoragefunction a data adapter asks for a collection's store. Stores present in the database but absent fromschemaare dropped on upgrade, so the schema is the complete description of what the database holds. The old per-collection databases are untouched and unread: open them yourself once and insert their contents if you need to keep the data. - Removed compatibility with
@signaldb/coreversions below2.0.0.
Added
- A query with an equality on the primary key or on an indexed field reads only the matching key range instead of the whole object store, when the collection uses the
AsyncDataAdapter, theAutoFetchDataAdapteror theWorkerDataAdapter. Results are unchanged; the remaining selector, sort and window are still applied by SignalDB.
Fixed
onUpgradereceives the version the database is upgraded from asoldVersion. It received the new version twice, so a migration that branches onoldVersionnever saw where it was coming from.- Queries on an indexed field that is not a string now return the right documents. The index was keyed by IndexedDB's own keys — the raw values — while SignalDB looks an index up by
serializeValue(value), so{ rank: 3 }matched nothing and{ rank: { $ne: 3 } }matched everything. Only string-valued fields were unaffected, which is why the existing tests did not catch it.
[1.1.0] - 2025-05-08
Fixed
Added
- Added support for custom database prefix option (thanks to @pierissimo!)
[1.0.0] - 2025-01-06
- Initial release