Repository navigation
Conversation
|
It is a great feature ! However, I'm not sure we want to re-expose the full emscripten filesystem API, and change the interface of the |
|
Also, looking at the generated assets, it looks like the changes in this pull request roughly double the size of |
|
The size increase will be mostly due to closure compiler's absence. Flushing caches may work, but I worry it would race between flush -> export, but then again I think we do all of that on one event loop tick so it might be okay if that's the case. |
The code is completely synchronous, no race is possible. |
|
Okay, it sounds like you don't want this feature to be done in this way, so closing this. |
|
@kegsay why this PR was closed? I've just read the thread and cannot understand. In our privacy focused note taking app we need to ensure data persistency.
In case we would have access to a What concerns you have against the feature implemented in current PR? |
|
@lovasoa what's alternative way I have as user of sqlite.js to export the data with no re-open database? |
This PR adds support for IDBFS by:
FS.syncfscan be called.DatabaseAPI to accept astringin addition to aUint8Arrayin its constructor, which setsthis.filenameaccordingly. This is to allow for backwards compatibility. Previously, passing strings would throw.There's one major shortcoming with this PR which is that I have to remove
--closure 1onEMFLAGS_OPTIMIZEDotherwise some methods onFSare minified (mountandsyncfsare affected). I'm unsure why the closure compiler is doing this.To use IDBFS, users need to:
IDBFS support is preferable in some cases over
Database.exportas that function will close the database/clear prepared statements and make theDatabasesubsequently unusable.SQL.FS.syncfshowever will not close the database.Fixes #302 but for clarity: this is just writing files, so is database-level scoped, not table/row level scoped.