3 ms·
I couldn't find do these wrappers support read-only SQLite databases with HTTP range requests, like in this famous post [1]. Phiresky's wrapper supports it, but
by Ciantic 3y ago
I couldn't find do these wrappers support read-only SQLite databases with HTTP range requests, like in this famous post [1]. Phiresky's wrapper supports it, but it seems to be rebuilding the whole sql.js [2], I'd rather have it as VFS on top of sqlite.org's own WASM module. I like the idea of HTTP range requests, but I don't want to run a fork, that will be unmaintained in few years.
[1]: https://news.ycombinator.com/item?id=27016630 https://news.ycombinator.com/item?id=27016630
[2]: https://github.com/phiresky/sql.js-httpvfs https://github.com/phiresky/sql.js-httpvfs
- samwillis 3y agoIt would be quite hard to do a HTTP range request VFS for the official build as it's sync only, lots of hoops to jump through. The wa-sqlite build on the other hand is available as both a sync and async build, and so should be quite possible (you can easily build an async VFS). Roy has a great range of example VFSs you can learn from too.
- sgbeal 3y ago> It would be quite hard to do a HTTP range request VFS for the official build as it's sync only, lots of hoops to jump through. As the developer of that build, i wholeheartedly confirm that. wa-sqlite makes use of asyncify, which is a feature we do not want to make use of in the canonical distribution because (to make a long story short) it's third-party voodoo which can be pulled out from under us, or break in incompatible ways, at any time, whereas the sqlite project has a long history of posting only its own code, without third-party dependencies. It's JS/WASM build necessarily depends on Emscripten, but we've also reimplemented all of that glue except for the parts which provide the WASM imports, which are closely tied to the compilation process so cannot simply be swapped out. > Roy has a great range of example VFSs you can learn from too. FWIW, his work has been a tremendous inspiration for the sqlite project's JS code, and the 2nd OPFS VFS is a direct port of one of his VFSes.
- samwillis 3y agoThe work that both Roy and yourself have put into SQLite in the browser is awesome, there are so many exciting things coming that are going to be built on top of it. Thank you!
- Ciantic 3y agoIt seems indeed very nice, the examples are clear and everything works from async. I tried with Deno, and now experimenting with my own VFS. It does seem to suffer from maintainer problems too though, and I don't blame Roy Hashimoto for that. I wouldn't want to maintain such an obvious wrapper when it should be a task for SQLite's team to upstream the changes. Roy Hashimoto doesn't want to maintain it as an NPM package for instance, as it is just an experiment: https://github.com/rhashimoto/wa-sqlite/issues/12 https://github.com/rhashimoto/wa-sqlite/issues/12 "Low traffic is a happy place - I don't have any motivation to mess with that."