method
configure_connection
v8.0.0 -
Show latest stable
-
0 notes -
Class: ActiveRecord::ConnectionAdapters::SQLite3Adapter
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7 (0)
- 5.2.3 (0)
- 6.0.0 (0)
- 6.1.3.1 (0)
- 6.1.7.7 (0)
- 7.0.0 (0)
- 7.1.3.2 (0)
- 7.1.3.4 (0)
- 7.2.3 (0)
- 8.0.0 (0)
- 8.1.1 (0)
- What's this?
configure_connection()
private
Hide source
# File activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb, line 815 def configure_connection if @config[:timeout] && @config[:retries] raise ArgumentError, "Cannot specify both timeout and retries arguments" elsif @config[:timeout] timeout = self.class.type_cast_config_to_integer(@config[:timeout]) raise TypeError, "timeout must be integer, not #{timeout}" unless timeout.is_a?(Integer) @raw_connection.busy_handler_timeout = timeout elsif @config[:retries] ActiveRecord.deprecator.warn(<<~MSG) The retries option is deprecated and will be removed in Rails 8.1. Use timeout instead. MSG retries = self.class.type_cast_config_to_integer(@config[:retries]) raw_connection.busy_handler { |count| count <= retries } end super pragmas = @config.fetch(:pragmas, {}).stringify_keys DEFAULT_PRAGMAS.merge(pragmas).each do |pragma, value| if ::SQLite3::Pragmas.method_defined?("#{pragma}=") @raw_connection.public_send("#{pragma}=", value) else warn "Unknown SQLite pragma: #{pragma}" end end end

