We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5361528 commit e3f95caCopy full SHA for e3f95ca
lib/sqlite3/database.rb
@@ -749,6 +749,21 @@ def translate_from_db types, row
749
@type_translator.call types, row
750
end
751
752
+ def statement_timeout=( milliseconds )
753
+ timeout_seconds = milliseconds.fdiv(1000)
754
+
755
+ progress_handler do
756
+ now = Process.clock_gettime(Process::CLOCK_MONOTONIC)
757
+ if @statement_timeout_deadline.nil?
758
+ @statement_timeout_deadline = now + timeout_seconds
759
+ elsif now > @statement_timeout_deadline
760
+ next false
761
+ else
762
+ true
763
+ end
764
765
766
767
private
768
769
NULL_TRANSLATOR = lambda { |_, row| row }
0 commit comments