node-db-mysql icon indicating copy to clipboard operation
node-db-mysql copied to clipboard

Stop query execution after timeout

Open fatshotty opened this issue 13 years ago • 0 comments

Hello there,

I should execute a query like this: select * from books where name='my book name' and author='my author name'

I have set a timeout to 5 seconds (client side) because this query can take more than 5 seconds.

Unfortunately query continues running although I've terminate my request.

I wonder is there a way to stop the execution of the Query?

I mean, is there a way to do something like this:

Query = this.query().select("*").from("books").where("name='my book name'");
setTimeout(function(){
  Query.stop()  // stop execution of the query
}, 5000);

Thanks in advance

fatshotty avatar Sep 18 '12 13:09 fatshotty