--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: Sets up multi_insert or import to use ON DUPLICATE KEY UPDATE If you pass no arguments, ALL fields will be updated with the new values. If you pass the fields you want then ONLY those field will be updated.
- !ruby/struct:SM::Flow::P 
  body: Useful if you have a unique key and want to update inserting rows that violate the unique key restriction.
- !ruby/struct:SM::Flow::P 
  body: "Examples:"
- !ruby/struct:SM::Flow::P 
  body: dataset.on_duplicate_key_update.multi_insert(
- !ruby/struct:SM::Flow::VERB 
  body: " [{:name =&gt; 'a', :value =&gt; 1}, {:name =&gt; 'b', :value =&gt; 2}]\n"
- !ruby/struct:SM::Flow::P 
  body: )
- !ruby/struct:SM::Flow::P 
  body: INSERT INTO tablename (name, value) VALUES (a, 1), (b, 2) ON DUPLICATE KEY UPDATE name=VALUES(name), value=VALUES(value)
- !ruby/struct:SM::Flow::P 
  body: dataset.on_duplicate_key_update(:value).multi_insert(
- !ruby/struct:SM::Flow::VERB 
  body: " [{:name =&gt; 'a', :value =&gt; 1}, {:name =&gt; 'b', :value =&gt; 2}]\n"
- !ruby/struct:SM::Flow::P 
  body: )
- !ruby/struct:SM::Flow::P 
  body: INSERT INTO tablename (name, value) VALUES (a, 1), (b, 2) ON DUPLICATE KEY UPDATE value=VALUES(value)
full_name: Sequel::MySQL::DatasetMethods#on_duplicate_key_update
is_singleton: false
name: on_duplicate_key_update
params: (*args)
visibility: public
