class ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter
Constants
- SCHEMA_QUERY_TYPES
Public Instance Methods
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
Source
# File lib/patches/db/oracle_enhanced.rb, line 31 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
Also aliased as: exec_insert_without_profiling
Alias for: exec_insert
Source
# File lib/patches/db/oracle_enhanced.rb, line 26 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
Source
# File lib/patches/db/oracle_enhanced.rb, line 36 def exec_update(sql, name, binds) mp_profile_sql(sql, name) { exec_update_without_profiling(sql, name, binds) } end
Also aliased as: exec_update_without_profiling, exec_delete
Source
# File lib/patches/db/oracle_enhanced.rb, line 21 def execute(sql, name = nil) mp_profile_sql(sql, name) { execute_without_profiling(sql, name) } end
Also aliased as: execute_without_profiling
Private Instance Methods
Source
# File lib/patches/db/oracle_enhanced.rb, line 47 def mp_profile_sql(sql, name, &blk) return yield unless mp_should_measure?(name) start = Process.clock_gettime(Process::CLOCK_MONOTONIC) 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
Source
# File lib/patches/db/oracle_enhanced.rb, line 65 def mp_should_measure?(name) return false unless SqlPatches.should_measure? !(Rack::MiniProfiler.config.skip_schema_queries && SCHEMA_QUERY_TYPES.include?(name)) end
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