Method: ActiveRecord::ConnectionAdapters::PostgreSQLAdapter#execute

Defined in:
lib/active_record/connection_adapters/postgresql_adapter.rb

#execute(sql, name = nil) ⇒ Object

Executes an SQL statement, returning a PGresult object on success or raising a PGError exception otherwise.



519
520
521
522
523
524
525
526
527
# File 'lib/active_record/connection_adapters/postgresql_adapter.rb', line 519

def execute(sql, name = nil)
  log(sql, name) do
    if @async
      @connection.async_exec(sql)
    else
      @connection.exec(sql)
    end
  end
end