IndexedDB: batchGetAll()
- Category
- Miscellaneous
- Type
- New or changed feature
- Status
- No active development (Chrome No active development)
- Intent stage
- Start prototyping
WPT details: We intend to get full test coverage as we build out the feature.
Summary
The new IDBObjectStore.batchGetAll() and IDBIndex.batchGetAll() will execute multiple getAll() calls in one query to avoid the request overhead of a burst of small queries.
Motivation
Currently, IDBObjectStore.getAll() and IDBIndex.getAll() takes an IDBKeyRange and returns an array of IDBValue. If a developer has the need to retrieve from multiple IDBKeyRanges, a burst of getAll() requests need to be issued. batchGetAll() methods will provide an ergonomic way to request multiple IDBKeyRanges while avoiding request overhead from event loops for bursts of small getAll() queries. This feature is requested by a partner via https://github.com/w3c/IndexedDB/issues/376.
Standards & signals
- Firefox: No signal
- Safari: No signal
- Web developers: Positive
- Tracking bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1294977
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=indexeddb-batchgetall
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+IndexedDB%3A%20batchGetAll()
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=IndexedDB%3A%20batchGetAll()
- Baseline status: https://webstatus.dev/?q=IndexedDB%3A%20batchGetAll()
Explainers: https://github.com/w3c/IndexedDB/issues/376