Add remove_object_store()/rename_object_store() to Databasebuilder to make reuse useful#41
Merged
Merged
Conversation
This allows to refer to `ObjectStoreBuilder`s by name and still keeping the insertion order.
Contributor
Author
|
Once this is merged, would you mind making a new release so we can stop using our fork? That'd be great. |
devashishdxt
requested changes
Dec 20, 2025
Comment on lines
+42
to
+45
| debug_assert!( | ||
| _previous_object_store_for_name.is_none(), | ||
| "we probably don't want to be overwriting object stores at any point" | ||
| ); |
Owner
There was a problem hiding this comment.
This assert is misleading. Using assert means that this thing is not possible and if it happens, it is a logic error in this crate. But, idb does not enforce users to not overwrite existing object stores. Users can create two object stores with same name, in which case, this'll panic (which is undesirable).
I can see there are assertions in other places too. I think it's best to remove them. Neither idb not IndexedDB stops user adding object stores with same name.
Contributor
Author
There was a problem hiding this comment.
Alright, I removed the debug assertions!
This will make handling removals more straightforward.
Internally, we cannot rely on just implicit removal when combining remove and rename: if a store is removed and another store is then renamed to the removed store name, implicit removal would not result in the correct sequence of operations.
devashishdxt
approved these changes
Dec 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #36