Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Asyncify and sqlite3_interrupt #25

Closed
twoxfh opened this issue Jun 20, 2021 · 1 comment
Closed

Asyncify and sqlite3_interrupt #25

twoxfh opened this issue Jun 20, 2021 · 1 comment

Comments

@twoxfh
Copy link

twoxfh commented Jun 20, 2021

This is a pretty cool implementation of sqlite wasm. I am looking to abort long running queries. I saw your Faq page about asyncify and wondered if I use it and implement sqlite3_interrupt should I be able to achieve aborting long queries? Thanks for any pointers and heads up.

@rhashimoto
Copy link
Owner

Please use Discussions for topics that are not Issues.

I could be wrong, but I suspect that sqlite3_interrupt will not work for a couple reasons. First, the wa-sqlite builds do not have threading enabled so I'm not certain whether it would be supported in SQLite itself. Second, there are some Emscripten run-time guards that prevent calling an Asyncify function while another Asyncify function is suspended, and that might come into play.

However, if the sqlite3_interrupt function does not work, another possible approach is to write a custom VFS that returns an error code from an I/O operation in order to abort a query. That won't always work - e.g. if the query doesn't need to make any I/O calls - but I expect those cases to be atypical in practice.

@rhashimoto rhashimoto changed the title Asyncify and sqlite3_interript Asyncify and sqlite3_interrupt Jun 20, 2021
Repository owner locked and limited conversation to collaborators Jun 20, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants