rust-indexed-db icon indicating copy to clipboard operation
rust-indexed-db copied to clipboard

Should `OpenDbRequest::set_on_upgrade_needed` take a callback that returns a future?

Open zecakeh opened this issue 2 years ago • 0 comments

In the callback we might need to await a transaction to make sure everything happens in the correct order.

For example porting the example of the "Structuring the database" section of MDN's guide is currently not possible.

They recommend to wait for the createObjectStore transaction to be completed before adding data in it. In Rust code that requires turning the transaction into a future.

zecakeh avatar Oct 31 '23 12:10 zecakeh