class BulkInsert::StatementAdapters::MySQLAdapter

Public Instance Methods

insert_ignore_statement() click to toggle source
# File lib/bulk_insert/statement_adapters/mysql_adapter.rb, line 6
def insert_ignore_statement
  'IGNORE'
end
on_conflict_statement(columns, _ignore, update_duplicates) click to toggle source
# File lib/bulk_insert/statement_adapters/mysql_adapter.rb, line 10
def on_conflict_statement(columns, _ignore, update_duplicates)
  return '' unless update_duplicates

  update_values = columns.map do |column|
    "`#{column.name}`=VALUES(`#{column.name}`)"
  end.join(', ')
  ' ON DUPLICATE KEY UPDATE ' + update_values
end
primary_key_return_statement(_primary_key) click to toggle source
# File lib/bulk_insert/statement_adapters/mysql_adapter.rb, line 19
def primary_key_return_statement(_primary_key)
  ''
end