SQLite Forum

Cancelling the query
> > The usual rules apply to the user helping the library [manage its state].

> OK, so I will still have to finalize the statement right?

That is one of the usual rules. There are others.

> I said I am running a thread checking if a new table is created by querying sqlite_master. And then I want to run another thread where I will execute SELECT FROM abc; When I hit ESC I want to interrupt the second SELECT statement.

That looks a lot like busy-waiting. I would be thinking about more direct coordination between threads, and awaking ones that suddenly have something to do with mutexes. 

> So it looks like the way to go is to use progress_handler().

If the connection you would be passing into sqlite3_interrupt() is sure to remain open during that call, that would be the simplest approach.