mariano / node-db-mysql

MySQL database bindings for Node.js
http://nodejsdb.org
150 stars 30 forks source link

Stop query execution after timeout #86

Open fatshotty opened 12 years ago

fatshotty commented 12 years ago

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