question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Split the async fs interface, indexedDB, and sqlite-specific code

See original GitHub issue

Hello ! This is very useful work you have been doing here. If I understand well, this repository contains both the Atomic and Shared Array Buffer logic required to provide an async interface on top of emscripten’s synchronous FS, and the code that implements this interface with an IndexedDB backend.

  • Is there any part of this code that is specific to sql.js, or could this be reused with any emscripten-compiled code that interacts with files ? If there is code that is specific to sql.js, then would it be feasible to split it from the sync-async bridge and the IndexedDB logic ?

  • Would it be possible to split the IndexedDB backend, in order to let the user provide a different implementation? I’m thinking about an HTTP backend in particular.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
kripkencommented, Aug 12, 2021

Interesting stuff here!

In general, I am hoping that we do a large rewrite of the emscripten FS code in the next few months (ASMFS, or related). So any large change might not make sense to add there atm. A small one might make sense though, as if it can be done as a small additional JS FS, then those will get ported to the new rewrite eventually (is the general plan).

I’d be interested to hear if there are things such a rewrite should do to make this easier. One goal is to write it to native code as much as possible to allow for easier sync/async interation, which from the description here sounds relevant. (cc @rstz who I’ve been talking with about this recently)

1reaction
jlongstercommented, Sep 19, 2021

@kripken Sorry for my delay – had a lot to catch up on in the last month. Going to be watching this from now on though.

I filed an issue describing the lock/unlock needs on emscripten: https://github.com/emscripten-core/emscripten/issues/15070

Sounds good about the rest of the filesystem changes. As long as there is a way to hook in some JS to those APIs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IndexedDB with promises and async/await - Filip Vitas - Medium
Show me the code. Let's write code to put some data into database. ... Although IndexedDB has asynchronous API, this looks so pretty,...
Read more >
IndexedDB - The Modern JavaScript Tutorial
The native interface to IndexedDB, described in the specification ... to split apart IndexedDB transactions and “other” async stuff.
Read more >
Jquery failing to call async and await for indexed db creation
Here is some sample code for you: function open(name, version) { return new Promise((resolve, reject) => { const request ...
Read more >
Untitled
Another import or export format, another table data populating strategy, another SQLite database format, SQL code formatter, code highlighter, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found