Module: ActiveRecord::DynamicTimeout::SqliteAdapterExtension

Defined in:
lib/active_record/dynamic_timeout/extensions/sqlite_adapter_extension.rb

Instance Method Summary collapse

Instance Method Details

#reset_connection_timeout(raw_connection) ⇒ Object



13
14
15
# File 'lib/active_record/dynamic_timeout/extensions/sqlite_adapter_extension.rb', line 13

def reset_connection_timeout(raw_connection)
  raw_connection.statement_timeout = 0
end

#set_connection_timeout(raw_connection, timeout_seconds) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/active_record/dynamic_timeout/extensions/sqlite_adapter_extension.rb', line 5

def set_connection_timeout(raw_connection, timeout_seconds)
  if timeout_seconds
    raw_connection.statement_timeout = (timeout_seconds * 1000).to_i
  else
    raw_connection.statement_timeout = 0
  end
end

#supports_dynamic_timeouts?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/active_record/dynamic_timeout/extensions/sqlite_adapter_extension.rb', line 21

def supports_dynamic_timeouts?
  SQLite3::VERSION >= "2"
end

#timeout_set_client_side?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/active_record/dynamic_timeout/extensions/sqlite_adapter_extension.rb', line 17

def timeout_set_client_side?
  true
end