X hits on this document

222 views

0 shares

0 downloads

0 comments

47 / 70

Temporary Tables

Not so good for slave replication

Can be used as a sandbox then imported into a real table with ar-extensions gem

Animal.create_temporary_table do |t|

 t.create!(:name =>       'giraffe',

           :password =>   'goo')

 Animal.insert_select(

     :from =>   t,

     :select => [:name, :password, :fav_beer],

     :into =>   [:name, :password, :fav_beer],

   :on_duplicate_key_update =>

                   [:password,   :fav_beer])

end

Document info
Document views222
Page views222
Page last viewedWed Jan 18 15:22:41 UTC 2017
Pages70
Paragraphs654
Words2352

Comments