-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Allow batch adding records (from an Array) #69
Comments
Yeah, a We'd have to performance test against the loop. I'm not entirely sure it'd be notably more efficient than the loop in most implementations; if the overhead is in the object serialization and (if necessary) index key generation it doesn't necessarily buy you anything. For kicks, can you share a minimal example that you'd expect to be significantly more efficient? Then implementers could give it a try and see. (I could whip something up but I might make some assumptions about what you're doing.) |
In addition to putAll, please also consider batch add/delete. Off the top of my head, something like a couple of these:
The missing functionality is basically |
addAll() makes sense along with putAll()
|
Ah, was basing my thoughts on https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/delete, where it is not clear that store.delete() can be a range and not just a value. Makes perfect sense now. So yes, the use case is specific to 68. Thanks! |
TPAC 2019 Web Apps breakout:
Follow-up: concrete proposal, solicit developer feedback |
Is |
Yeah, the implementation we ended up with didn't show any performance improvements, and we plan to back out the code. It's possible we didn't spend enough time optimizing the solution. We'd welcome hearing from other implementers if they do see a performance improvement that can't be achieved through other quality-of-implementation work. |
I'm not sure if this follows the correct procedure for feature requests, but here I go.
I recently had the issue that I wanted to fill an indexedDB (initially) with a very large Array of Objects. However looping through the Array and adding the Objects one by one was very inefficient. Wouldn't it make sense to have an equivalent of
getAll()
with adding Records?The text was updated successfully, but these errors were encountered: