Ruby on Rails 5.2 - ActiveRecord::ConnectionAdapters::MySQL::DatabaseStatements

मॉड्यूल ActiveRecord :: ConnectionAdapters :: MySQL :: DatabaseStatements




ruby

मॉड्यूल ActiveRecord :: ConnectionAdapters :: MySQL :: DatabaseStatements

सार्वजनिक प्रवृत्ति के तरीके

exec_delete (sql, name = nil, binds = []) स्रोत दिखाएं
# File activerecord/lib/active_record/connection_adapters/mysql/database_statements.rb, line 43
def exec_delete(sql, name = nil, binds = [])
  if without_prepared_statement?(binds)
    execute_and_free(sql, name) { @connection.affected_rows }
  else
    exec_stmt_and_free(sql, name, binds) { |stmt| stmt.affected_rows }
  end
end
इसके अलावा उपनाम: exec_update
exec_query (sql, name = "SQL", binds = [], ready : false) स्रोत दिखाएं
# File activerecord/lib/active_record/connection_adapters/mysql/database_statements.rb, line 31
def exec_query(sql, name = "SQL", binds = [], prepare: false)
  if without_prepared_statement?(binds)
    execute_and_free(sql, name) do |result|
      ActiveRecord::Result.new(result.fields, result.to_a) if result
    end
  else
    exec_stmt_and_free(sql, name, binds, cache_stmt: prepare) do |_, result|
      ActiveRecord::Result.new(result.fields, result.to_a) if result
    end
  end
end
exec_update (sql, name = nil, binds = [])
इसके लिए उपनाम: exec_delete
execute (sql, name = nil) स्रोत दिखाएं
# File activerecord/lib/active_record/connection_adapters/mysql/database_statements.rb, line 23
def execute(sql, name = nil)
  # make sure we carry over any changes to ActiveRecord::Base.default_timezone that have been
  # made since we established the connection
  @connection.query_options[:database_timezone] = ActiveRecord::Base.default_timezone

  super
end

इस कनेक्शन के संदर्भ में SQL कथन निष्पादित करता है।

सुपरक्लास विधि कहता है