class ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter

Constants

SCHEMA_QUERY_TYPES

Public Instance Methods

exec_delete(sql, name, binds)

See oracle-enhanced/lib/active_record/connection_adapters/oracle_enhanced_database_statements.rb:183 where the exec delete method is aliased in the same way. We just have to do it again here to make sure the new exec_delete alias is linked to our profiling-enabled version.

Alias for: exec_update
exec_insert(sql, name, binds, pk = nil, sequence_name = nil) click to toggle source
# File lib/patches/db/oracle_enhanced.rb, line 29
def exec_insert(sql, name, binds, pk = nil, sequence_name = nil)
  mp_profile_sql(sql, name) { exec_insert_without_profiling(sql, name, binds, pk, sequence_name) }
end
exec_insert_without_profiling(sql, name, binds, pk = nil, sequence_name = nil)
Alias for: exec_insert
exec_query(sql, name = 'SQL', binds = []) click to toggle source
# File lib/patches/db/oracle_enhanced.rb, line 24
def exec_query(sql, name = 'SQL', binds = [])
  mp_profile_sql(sql, name) { exec_query_without_profiling(sql, name, binds) }
end
Also aliased as: exec_query_without_profiling
exec_query_without_profiling(sql, name = 'SQL', binds = [])
Alias for: exec_query
exec_update(sql, name, binds) click to toggle source
# File lib/patches/db/oracle_enhanced.rb, line 34
def exec_update(sql, name, binds)
  mp_profile_sql(sql, name) { exec_update_without_profiling(sql, name, binds) }
end
exec_update_without_profiling(sql, name, binds)
Alias for: exec_update
execute(sql, name = nil) click to toggle source
# File lib/patches/db/oracle_enhanced.rb, line 19
def execute(sql, name = nil)
  mp_profile_sql(sql, name) { execute_without_profiling(sql, name) }
end
Also aliased as: execute_without_profiling
execute_without_profiling(sql, name = nil)
Alias for: execute

Private Instance Methods

mp_profile_sql(sql, name) { || ... } click to toggle source
# File lib/patches/db/oracle_enhanced.rb, line 45
def mp_profile_sql(sql, name, &blk)
  return yield unless mp_should_measure?(name)

  start        = Time.now
  result       = yield
  elapsed_time = SqlPatches.elapsed_time(start)
  record       = ::Rack::MiniProfiler.record_sql(sql, elapsed_time)

  # Some queries return the row count as a Fixnum and will be frozen, don't save a record
  # for those.
  result.instance_variable_set("@miniprofiler_sql_id", record) if (result && !result.frozen?)

  result
end
mp_should_measure?(name) click to toggle source

Only measure when profiling is enabled When skip_schema_queries is set to true, it will ignore any query of the types in the schema_query_types array

# File lib/patches/db/oracle_enhanced.rb, line 63
def mp_should_measure?(name)
  return false unless SqlPatches.should_measure?

  !(Rack::MiniProfiler.config.skip_schema_queries && SCHEMA_QUERY_TYPES.include?(name))
end