Node support
I'd like to use something like this for Node, and I see this project already offers some support for the browser, so could it make sense to support Node too in the future?
Alternatively, could it make sense to offer an "abstract" implementation that receives the storage APIs as an argument, so it could potentially work anywhere?
I think I'm going to try to write a VFS for Node, and reuse as much as possible of what's already implemented here. If you folks are open to it I'd be happy to submit a PR for it, once done.
I’d be happy to have support for something like this!
Depending on how it’s done, it might even be possible to make this work with a one-time runtime check at startup; but let’s start with node support in the same style as the browser support.
I've put together a VFS implementation for Node, you can find it here.
I've pretty interested in deleting my fork and just somehow bundling deno-sqlite for my use case. I think the ideal scenario for me would be something like this:
- deno-sqlite would expose a special "abstract" implementation that takes both sqlite's buffer and the VFS implementation to use as input.
- the VFS for Node is merged into this repo and potentially exposed similarly to how the indexeddb VFS is exposed.
- some way to run tests with the various VFS implementations is implemented (currently I can't run Deno.test tests in Node, for example, and I wouldn't want to not be able to run tests at all for Node).
- on my end I'd just clone deno-sqlite, build the sqlite version that I need, and wire together deno-sqlite's abstract implementation, the VFS for Node, and the custom sqlite build.
I don't know if that's reasonable for this project, I hope it is.