Class: ActiveRecord::ConnectionAdapters::PostgreSQLAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/action_cost/extensions/postgresql_adapter.rb

Instance Method Summary collapse

Instance Method Details

#exec_query_with_action_cost(sql, name = '', binds = []) ⇒ Object



14
15
16
17
18
19
# File 'lib/action_cost/extensions/postgresql_adapter.rb', line 14

def exec_query_with_action_cost(sql, name='', binds = [])
  #Rails.logger.debug "exec_query_with_action_cost: #{sql}"
  parser = ActionCost::SqlParser.new(sql)
  ActionCost::Middleware.push_sql_parser(parser)
  exec_query_without_action_cost(sql, name, binds)
end

#execute_with_action_cost(sql, name = '') ⇒ Object



5
6
7
8
9
10
# File 'lib/action_cost/extensions/postgresql_adapter.rb', line 5

def execute_with_action_cost(sql, name='')
  #Rails.logger.debug "execute_with_action_cost: #{sql}"
  parser = ActionCost::SqlParser.new(sql)
  ActionCost::Middleware.push_sql_parser(parser)
  execute_without_action_cost(sql, name)
end