Design: IndexedDb access?

Created on 29 Sep 2018  ·  6Comments  ·  Source: WebAssembly/design

Hi,

Q: I'm a complete wasm newb and am about to start writing a SPA in Rust using yew. My project requires lots of interaction with IndexedDb. My question is can WebAssembly interact with IndexedDb and if so does it have to go though JavaScript first? I've read that I/O heavy applications are actually slower in WebAssembly because of the requirement to go through JavaScript and would like to put my doubts to rest.

Thank you for you time in answering this question!

Most helpful comment

@russoturisto
I would love to know the outcome. I am thinking about using wasm with indexeddb too

All 6 comments

You can access IndexedDb through the host, you need to import JavaScript functions that interacts with IndexedDb.

Understood. Thank you! :)

A small follow up question: Is there a proposal out there to allow direct access between WebAssembly and IndexedDb? If there isn't should there be one?

Thanks, :)

@russoturisto I believe that is covered by the host-bindings proposal which allows wasm direct access to host APIs (including browser APIs).

You can see an overview of the proposal here.

Awesome! Thank you so much! :)

@russoturisto
I would love to know the outcome. I am thinking about using wasm with indexeddb too

Was this page helpful?
0 / 5 - 0 ratings

Related issues

badumt55 picture badumt55  ·  8Comments

bobOnGitHub picture bobOnGitHub  ·  6Comments

Artur-A picture Artur-A  ·  3Comments

arunetm picture arunetm  ·  7Comments

konsoletyper picture konsoletyper  ·  6Comments