Is there a way to abort an SQLite call?

I am using SQLite3 in a windows application. I have the source code (the so-called SQLite join).

Sometimes I have to perform heavy queries. That is, I call sqlite3_stepthe prepared statement, and it takes a long time to complete (due to the large load of I / O).

I wonder if there is an opportunity to interrupt such a call. I would also be happy if it were possible to do some background processing in the middle of a call inside the same thread (since most of the time is spent waiting for I / O to complete).

I was thinking about changing the SQLite code myself. In the simplest scenario, I could check some condition (for example, an interrupt event descriptor, for example) before each call or ReadFile/ WriteFile, and return the error code accordingly. And to ensure background processing, the file must be opened in overlap mode (this allows asynchronously ReadFile/ WriteFile).

Is there a chance that an interrupt WriteFilecould in some cases leave the database in an inconsistent state, even if the log is turned on? I think not, since the whole idea of ​​a log file should be prepared for any error of any kind. But I would like to hear more about this.

Also, has anyone tried something like this?

Thanks in advance.

EDIT:

Thanks ereOn. I did not know about the existence sqlite3_interrupt. This probably answers my question.

, , , ( ) - .

, "Overlapped I/O".

http://en.wikipedia.org/wiki/Overlapped_I/O

, / , . - : , , APC, .

, . - , (.. ), ( ).

, - . , ( ..).

, /API- , .

EDIT2:

, thansk to ereOn.

, , - " ", "" - -. , , . , .

Windows ( ), . -, , " ".

, " " "". , . , " ".

+3
2

, , , , : , -, - . (, "" )

, , , .

sqlite3_interrupt(). , , , .

+2

SQLite . , Sqlite , SQLite .

, sqlite -, , , , (, ). SQLite , , , ( ) .

+1

Source: https://habr.com/ru/post/1769087/


All Articles