-
Notifications
You must be signed in to change notification settings - Fork 105
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
bounding number/size of requests #19
Comments
This is a good idea, but it would probably require some abstraction busting since the file system layer doesn't know anything about which query it is currently answering.. Otherwise it would be possible by sending a cancellation signal from the main thread, but that would probably require SharedArrayBuffer for signalling since everything in the worker thread happens synchronously. Adding a dependency to SharedArrayBuffer isn't great since it's not supported in many cases. |
I'm happy to bust some abstractions! https://github.com/bakkot/sql.js-httpvfs#a-fork-of-sqljs-httpvfs-which-bounds-the-number-of-requests (See this commit. It's just overriding I imagine this is too gross to include in the actual repo (especially since it seems to put the database into an unrecoverable state - as would a network error, from what I can tell?), so I haven't PR'd it, but it does work. Happy to send a PR if you'd like, though. |
I think the reason error throws "corrupt" the database is since emscripten doesn't handle exceptions at all by default, leaving SQLite in an undefined state. You should be able to avoid that by returning an I/O error instead. That should be possible with something similar to As an aside you don't need to add your own event handler to the worker etc, you can add your functions to If all that works cleanly, I think this would be a good addition to the library itself |
It'd be nice to have the ability to bail out if a query is going to require too much data, rather than potentially fetching arbitrarily large amounts of data.
The text was updated successfully, but these errors were encountered: