brightway-lca / brightway-live

🖥️🌿 Browser-based JupyterHub for Brightway (built on WASM, either based on emscripten-forge or on Pyodide)
https://live.brightway.dev
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

File System Issues (`sql`) #10

Open michaelweinold opened 1 year ago

michaelweinold commented 1 year ago

Currently, an error is raised when trying to query a SQLite database. This affects the use of peewee:

The present workaround is to not use /drive:

(...) I think it because the the current directory (/drive) is not a MEMFS (unlike the rest of the file system), but rather a DriveFS used, from what I understand, for notebook persistance. Probably it's even less POSIX compliant than MEMFS, which becomes an issue for sqlite. If you write in any other folder say /tmp/ the above example would work.

Ultimately, the issue seems to be with drivefs:

I think the code that needs to be checked is the drivefs, which I guess is ultimately backed by localForage:

michaelweinold commented 3 months ago

Current efforts to improve the JupyterLite file system through the use of iDrive:

and through the use of SharedArrayBuffer:

Unfortunately, these improvements did not affect the original SQL issue.

michaelweinold commented 1 month ago

There is a new "WASM-native" SQLite version. Unfortunately, this will not solve the SQL issue either:

This won't help us because we need to link it into an Emscripten shared libraray (or the main binary). They have their own loader code.

michaelweinold commented 1 month ago

There might be potential for a collaboration, following the discussions here:

Both @psychemedia and @bollwyvl are interested in using SQL in a Pyodide/JupyterLite environment.

michaelweinold commented 1 month ago