1.Dd December 19, 2018 2.Dt SQLITE3_INTERRUPT 3 3.Os 4.Sh NAME 5.Nm sqlite3_interrupt 6.Nd Interrupt A Long-Running Query 7.Sh SYNOPSIS 8.Ft void 9.Fo sqlite3_interrupt 10.Fa "sqlite3*" 11.Fc 12.Sh DESCRIPTION 13This function causes any pending database operation to abort and return 14at its earliest opportunity. 15This routine is typically called in response to a user action such 16as pressing "Cancel" or Ctrl-C where the user wants a long query operation 17to halt immediately. 18.Pp 19It is safe to call this routine from a thread different from the thread 20that is currently running the database operation. 21But it is not safe to call this routine with a database connection 22that is closed or might close before sqlite3_interrupt() returns. 23.Pp 24If an SQL operation is very nearly finished at the time when sqlite3_interrupt() 25is called, then it might not have an opportunity to be interrupted 26and might continue to completion. 27.Pp 28An SQL operation that is interrupted will return SQLITE_INTERRUPT. 29If the interrupted SQL operation is an INSERT, UPDATE, or DELETE that 30is inside an explicit transaction, then the entire transaction will 31be rolled back automatically. 32.Pp 33The sqlite3_interrupt(D) call is in effect until all currently running 34SQL statements on database connection D complete. 35Any new SQL statements that are started after the sqlite3_interrupt() 36call and before the running statements reaches zero are interrupted 37as if they had been running prior to the sqlite3_interrupt() call. 38New SQL statements that are started after the running statement count 39reaches zero are not effected by the sqlite3_interrupt(). 40A call to sqlite3_interrupt(D) that occurs when there are no running 41SQL statements is a no-op and has no effect on SQL statements that 42are started after the sqlite3_interrupt() call returns. 43.Sh SEE ALSO 44.Xr sqlite3 3 , 45.Xr SQLITE_OK 3 46