Module: Cequel::Record::BulkWrites Abstract

Included in:
LazyRecordCollection, RecordSet
Defined in:
lib/cequel/record/bulk_writes.rb

Overview

This module is abstract.

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.

Since:

  • 1.0.0

Instance Method Summary collapse

Instance Method Details

#delete_allvoid

This method returns an undefined value.

Delete all matched records without executing callbacks

Since:

  • 1.0.0



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_allvoid

This method returns an undefined value.

Destroy all matched records, executing destroy callbacks for each record.

Since:

  • 1.0.0



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.

Parameters:

  • attributes (Hash)

    map of column names to values

Since:

  • 1.0.0



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