aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/insert_all.rb
Commit message (Collapse)AuthorAgeFilesLines
* Use accessors internally; remove needless validationKasper Timm Hansen2019-03-311-6/+2
|
* Mark InsertAll as private API. Easier to add later.Kasper Timm Hansen2019-03-311-1/+1
|
* Capture some join calls.Kasper Timm Hansen2019-03-311-4/+8
|
* Bulk Insert: Reuse indexes for unique_byKasper Timm Hansen2019-03-201-20/+31
| | | | | | | | | | | I found `:unique_by` with `:columns` and `:where` inside it tough to grasp. The documentation only mentioned indexes and partial indexes. So why duplicate a model's indexes in an insert_all/upsert_all call when we can just look it up? This has the added benefit of raising if no index is found, such that people can't insert thousands of records without relying on an index of some form.
* Simplify values_list with more compositionKasper Timm Hansen2019-03-181-24/+30
| | | | This also prevents insert_all from leaking its attributes checks.
* Extract column check in values_listKasper Timm Hansen2019-03-181-14/+14
| | | | | | `values_list` is quite long and does far too many things. This also eagerly extract the keys in initialize instead of having to worry about calling them multiple times.
* Raise UnknownAttributeError when unknown column is passed to insert_all and ↵Josef Šimánek2019-03-161-0/+8
| | | | friends.
* Add some whitespace for readability.Kasper Timm Hansen2019-03-061-0/+2
|
* Handle blank inserts like update_all; raise upfront.Kasper Timm Hansen2019-03-061-6/+4
|
* Add insert_all to ActiveRecord models (#35077)Bob Lail2019-03-051-0/+153
Adds a method to ActiveRecord allowing records to be inserted in bulk without instantiating ActiveRecord models. This method supports options for handling uniqueness violations by skipping duplicate records or overwriting them in an UPSERT operation. ActiveRecord already supports bulk-update and bulk-destroy actions that execute SQL UPDATE and DELETE commands directly. It also supports bulk-read actions through `pluck`. It makes sense for it also to support bulk-creation.