instance method execute

Ruby on Rails 4.0.13

Since v3.2.22.5 Last seen in v7.0.10

Available in: v3.2.22.5 v4.0.13 v4.1.16 v4.2.9 v5.2.8.1 v6.0.6 v6.1.7.10 v7.0.10

Signature

execute(sql, name = nil)

Executes the SQL statement in the context of this connection.

Parameters

sql req
name opt = nil
Source
# File activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb, line 283
      def execute(sql, name = nil)
        if name == :skip_logging
          @connection.query(sql)
        else
          log(sql, name) { @connection.query(sql) }
        end
      rescue ActiveRecord::StatementInvalid => exception
        if exception.message.split(":").first =~ /Packets out of order/
          raise ActiveRecord::StatementInvalid.new("'Packets out of order' error was received from the database. Please update your mysql bindings (gem install mysql) and read http://dev.mysql.com/doc/mysql/en/password-hashing.html for more information. If you're on Windows, use the Instant Rails installer to get the updated mysql bindings.", exception.original_exception)
        else
          raise
        end
      end

Defined in activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb line 283 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter

Type at least 2 characters to search.

↑↓ navigate · open · esc close