Skip to content

Asyncify and sqlite3_interrupt #26

Unanswered
twoxfh asked this question in Q&A
Asyncify and sqlite3_interrupt #26
Jun 20, 2021 · 1 answer

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.

Replies

1 suggested answer

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.

0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue