Sha256: 1c3c85750f30546a88f6d5bba7dd4b342185645d957b6c58b92fce8930eeb4e1
Contents?: true
Size: 570 Bytes
Versions: 5
Compression:
Stored size: 570 Bytes
Contents
require_relative 'base_adapter' module BulkInsert module StatementAdapters class MySQLAdapter < BaseAdapter def insert_ignore_statement 'IGNORE' end 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 def primary_key_return_statement(_primary_key) '' end end end end
Version data entries
5 entries across 5 versions & 2 rubygems