Bulk insert support in Rails 6

All of these new methods allow inserting multiple records of the same model into the database. A single INSERT SQL query is prepared by these methods and a single sql statement is sent to the database without instantiating the model or invoking Active Record callbacks or validations.During bulk insertion, violation of primary key, violation of unique indexes and violation of unique constraints is possible. Rails leverages database-specific features to either skip or upsert the duplicates depending on the case.
Bulk insert support in Rails 6 #ruby #rubydeveloper #rubyonrails

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles