You can create a query that is effectively an infinite loop. For example: > WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c) > SELECT x FROM c WHERE x<0; There are a number of ways to set a timeout on a query. Perhaps the easiest to implement is to start a timer in a separate thread and then invoke [sqlite3_interrupt()][1] if the timer expires. You can also set a [progress callback][2] that is invoked periodically, and on each invocation of the callback, check the current time to see if the query has been running too long, and stop the query by returning non-zero from the progress callback itself. [1]: https://sqlite.org/c3ref/interrupt.html [2]: https://sqlite.org/c3ref/progress_handler.html The above methods work for C-code. I don't know about the bindings to C#, but I'm suspect something similar must exist there.