X hits on this document

139 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 views139
Page views139
Page last viewedSat Dec 03 06:46:12 UTC 2016
Pages70
Paragraphs654
Words2352

Comments