Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node support #239

Open
fabiospampinato opened this issue Aug 19, 2023 · 3 comments
Open

Node support #239

fabiospampinato opened this issue Aug 19, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@fabiospampinato
Copy link

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?

@fabiospampinato
Copy link
Author

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.

@dyedgreen
Copy link
Owner

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.

@dyedgreen dyedgreen added the enhancement New feature or request label Aug 20, 2023
@fabiospampinato
Copy link
Author

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:

  1. deno-sqlite would expose a special "abstract" implementation that takes both sqlite's buffer and the VFS implementation to use as input.
  2. the VFS for Node is merged into this repo and potentially exposed similarly to how the indexeddb VFS is exposed.
  3. 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).
  4. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants