mysql2 icon indicating copy to clipboard operation
mysql2 copied to clipboard

How to interrupt a streamed query?

Open fxn opened this issue 3 years ago • 0 comments

I want to process a huge result set until certain condition is reached. However

result = conn.query("...", stream: true, cache_rows: false)
result.each do |row|
  break
end

does not interrupt the iterator. Not even exit exists the interpreter.

What is the correct way to do that?

fxn avatar Sep 10 '20 15:09 fxn