Module: Cequel::Record::BulkWrites Abstract
- Included in:
- LazyRecordCollection, RecordSet
- Defined in:
- lib/cequel/record/bulk_writes.rb
Overview
Including modules must implement ‘key_attributes_for_each_row`, which should yield successive fully-specified key attributes for each result row.
This module implements bulk update and delete functionality for classes that expose a collection of result rows.
Instance Method Summary collapse
-
#delete_all ⇒ void
Delete all matched records without executing callbacks.
-
#destroy_all ⇒ void
Destroy all matched records, executing destroy callbacks for each record.
-
#update_all(attributes) ⇒ void
Update all matched records with the given column values, without executing callbacks.
Instance Method Details
#delete_all ⇒ void
This method returns an undefined value.
Delete all matched records without executing callbacks
31 32 33 |
# File 'lib/cequel/record/bulk_writes.rb', line 31 def delete_all each_data_set { |data_set| data_set.delete } end |
#destroy_all ⇒ void
This method returns an undefined value.
Destroy all matched records, executing destroy callbacks for each record.
41 42 43 |
# File 'lib/cequel/record/bulk_writes.rb', line 41 def destroy_all each { |record| record.destroy } end |
#update_all(attributes) ⇒ void
This method returns an undefined value.
Update all matched records with the given column values, without executing callbacks.
22 23 24 |
# File 'lib/cequel/record/bulk_writes.rb', line 22 def update_all(attributes) each_data_set { |data_set| data_set.update(attributes) } end |