rexie icon indicating copy to clipboard operation
rexie copied to clipboard

Handling of `onupgradeneeded` event should be customizable

Open dullbananas opened this issue 3 years ago • 5 comments

dullbananas avatar Jun 22 '22 19:06 dullbananas

Hi. Thanks for creating this issue. Can you explain your use case that requires custom upgrade handling?

devashishdxt avatar Jun 23 '22 00:06 devashishdxt

Database upgrades can require more than just the addition and deletion of object stores. They sometimes involve adding fields, merging object stores, changing the layout of an ArrayBuffer field, etc.

dullbananas avatar Jun 23 '22 01:06 dullbananas

Hi @dullbananas, this feature will be added to rexie. But, I'm not sure of timeline yet. In the meantime, you can try using idb crate which offers similar functionality with support for custom upgrade handlers (but, it has a low level API which is more closer to indexed db API on the browser).

devashishdxt avatar Aug 16 '22 01:08 devashishdxt

+1 to the utility of custom upgrade handlers. It's necessary to perform arbitrary migrations as data models evolve. I'll check out idb.

jbowens avatar Dec 31 '22 18:12 jbowens

I know this is a roadmapped feature but how are people handling this at the moment until v0.5?

peteringram0 avatar Apr 30 '23 19:04 peteringram0

I know this is a roadmapped feature but how are people handling this at the moment until v0.5?

You can use idb crate if you want to customise the upgrade handler. The latest version of rexie also uses idb internally.

devashishdxt avatar Jul 04 '24 07:07 devashishdxt