Module: Cassanity

Defined in:
lib/cassanity.rb,
lib/cassanity/error.rb,
lib/cassanity/range.rb,
lib/cassanity/client.rb,
lib/cassanity/column.rb,
lib/cassanity/schema.rb,
lib/cassanity/removal.rb,
lib/cassanity/version.rb,
lib/cassanity/addition.rb,
lib/cassanity/keyspace.rb,
lib/cassanity/migrator.rb,
lib/cassanity/operator.rb,
lib/cassanity/decrement.rb,
lib/cassanity/increment.rb,
lib/cassanity/migration.rb,
lib/cassanity/statement.rb,
lib/cassanity/connection.rb,
lib/cassanity/set_removal.rb,
lib/cassanity/operators/eq.rb,
lib/cassanity/operators/gt.rb,
lib/cassanity/operators/lt.rb,
lib/cassanity/set_addition.rb,
lib/cassanity/column_family.rb,
lib/cassanity/operators/gte.rb,
lib/cassanity/operators/lte.rb,
lib/cassanity/collection_item.rb,
lib/cassanity/migration_proxy.rb,
lib/cassanity/executors/cql_rb.rb,
lib/cassanity/instrumenters/noop.rb,
lib/cassanity/instrumenters/memory.rb,
lib/cassanity/cql/reconnectable_driver.rb,
lib/cassanity/argument_generators/batch.rb,
lib/cassanity/instrumentation/subscriber.rb,
lib/cassanity/result_transformers/mirror.rb,
lib/cassanity/argument_generators/columns.rb,
lib/cassanity/result_transformers/columns.rb,
lib/cassanity/argument_generators/keyspaces.rb,
lib/cassanity/result_transformers/keyspaces.rb,
lib/cassanity/argument_generators/index_drop.rb,
lib/cassanity/argument_generators/set_clause.rb,
lib/cassanity/instrumentation/log_subscriber.rb,
lib/cassanity/retry_strategies/retry_n_times.rb,
lib/cassanity/argument_generators/with_clause.rb,
lib/cassanity/retry_strategies/retry_strategy.rb,
lib/cassanity/argument_generators/index_create.rb,
lib/cassanity/argument_generators/keyspace_use.rb,
lib/cassanity/argument_generators/limit_clause.rb,
lib/cassanity/argument_generators/order_clause.rb,
lib/cassanity/argument_generators/using_clause.rb,
lib/cassanity/argument_generators/where_clause.rb,
lib/cassanity/argument_generators/keyspace_drop.rb,
lib/cassanity/instrumentation/statsd_subscriber.rb,
lib/cassanity/instrumentation/metriks_subscriber.rb,
lib/cassanity/argument_generators/column_families.rb,
lib/cassanity/argument_generators/keyspace_create.rb,
lib/cassanity/result_transformers/column_families.rb,
lib/cassanity/result_transformers/result_to_array.rb,
lib/cassanity/retry_strategies/exponential_backoff.rb,
lib/cassanity/argument_generators/column_family_drop.rb,
lib/cassanity/argument_generators/column_family_alter.rb,
lib/cassanity/argument_generators/column_family_create.rb,
lib/cassanity/argument_generators/column_family_delete.rb,
lib/cassanity/argument_generators/column_family_insert.rb,
lib/cassanity/argument_generators/column_family_select.rb,
lib/cassanity/argument_generators/column_family_update.rb,
lib/cassanity/argument_generators/column_family_truncate.rb

Defined Under Namespace

Modules: ArgumentGenerators, Cql, Executors, Instrumentation, Instrumenters, Operators, ResultTransformers, RetryStrategies Classes: Addition, Client, CollectionItem, Column, ColumnFamily, Connection, Decrement, Error, Increment, Keyspace, Migration, MigrationProxy, Migrator, Operator, Removal, Schema, SetAddition, SetRemoval, Statement

Constant Summary collapse

UnknownCommand =

Raised when an argument generator is asked to perform an unknown command.

Class.new(Error)
MigrationOperationNotSupported =

Raised when a migration operation is attempted that is not supported.

Class.new(Error)
Range =

For now, cassanity’s range can just be a core range.

::Range
VERSION =
"0.6.0"

Class Method Summary collapse

Class Method Details

.add(*values) ⇒ Object

Public: Shortcut for returning an addition value for a list collection.

values - The values to add to the list.

Returns an Cassanity::Addition instance.



96
97
98
# File 'lib/cassanity.rb', line 96

def self.add(*values)
  Addition.new(*values)
end

.Addition(*args) ⇒ Object



2
3
4
# File 'lib/cassanity/addition.rb', line 2

def self.Addition(*args)
  Addition.new(*args)
end

.CollectionItem(*args) ⇒ Object



2
3
4
# File 'lib/cassanity/collection_item.rb', line 2

def self.CollectionItem(*args)
  CollectionItem.new(*args)
end

.dec(value = 1) ⇒ Object Also known as: decr, decrement

Public: Shortcut for returning a decrement value for a counter update.

value - The value to initialize the decrement with (optional, default: 1).

Returns a Cassanity::Decrement instance.



75
76
77
# File 'lib/cassanity.rb', line 75

def self.dec(value = 1)
  Decrement.new(value)
end

.Decrement(*args) ⇒ Object



2
3
4
# File 'lib/cassanity/decrement.rb', line 2

def self.Decrement(*args)
  Decrement.new(*args)
end

.eq(*args) ⇒ Object Also known as: equal

Public: Shortcut for returning an equality operator.

args - The arguments to pass to the initialize method of the operator.

Returns a Cassanity::Operators::Eq instance.



21
22
23
# File 'lib/cassanity.rb', line 21

def self.eq(*args)
  Operators::Eq.new(*args)
end

.gt(*args) ⇒ Object Also known as: greater_than

Public: Shortcut for returning a greater than operator.

args - The arguments to pass to the initialize method of the operator.

Returns a Cassanity::Operators::Gt instance.



48
49
50
# File 'lib/cassanity.rb', line 48

def self.gt(*args)
  Operators::Gt.new(*args)
end

.gte(*args) ⇒ Object Also known as: greater_than_or_equal_to

Public: Shortcut for returning a greater than or equal to operator.

args - The arguments to pass to the initialize method of the operator.

Returns a Cassanity::Operators::Gte instance.



57
58
59
# File 'lib/cassanity.rb', line 57

def self.gte(*args)
  Operators::Gte.new(*args)
end

.inc(value = 1) ⇒ Object Also known as: incr, increment

Public: Shortcut for returning an increment value for a counter update.

value - The value to initialize the increment with (optional, default: 1).

Returns a Cassanity::Increment instance.



66
67
68
# File 'lib/cassanity.rb', line 66

def self.inc(value = 1)
  Increment.new(value)
end

.Increment(*args) ⇒ Object



2
3
4
# File 'lib/cassanity/increment.rb', line 2

def self.Increment(*args)
  Increment.new(*args)
end

.item(key, value) ⇒ Object

Public: Shortcut for returning a collection item.

key - The item key in the list/map collection value - The item value.

Returns a Cassanity::CollectionItem instance.



133
134
135
# File 'lib/cassanity.rb', line 133

def self.item(key, value)
  CollectionItem.new(key, value)
end

.lt(*args) ⇒ Object Also known as: less_than

Public: Shortcut for returning a less than operator.

args - The arguments to pass to the initialize method of the operator.

Returns a Cassanity::Operators::Lt instance.



30
31
32
# File 'lib/cassanity.rb', line 30

def self.lt(*args)
  Operators::Lt.new(*args)
end

.lte(*args) ⇒ Object Also known as: less_than_or_equal_to

Public: Shortcut for returning a less than or equal to operator.

args - The arguments to pass to the initialize method of the operator.

Returns a Cassanity::Operators::Lte instance.



39
40
41
# File 'lib/cassanity.rb', line 39

def self.lte(*args)
  Operators::Lte.new(*args)
end

.Operator(*args) ⇒ Object



2
3
4
# File 'lib/cassanity/operator.rb', line 2

def self.Operator(*args)
  Operator.new(*args)
end

.range(start, finish, exclusive = false) ⇒ Object

Public: Shortcut for returning a range value.

start - The start value for the range. finish - The finish value for the range. exclusive - The Boolean value for whether or not to include the finish of

the range.

Returns a Cassanity::Range instance.



87
88
89
# File 'lib/cassanity.rb', line 87

def self.range(start, finish, exclusive = false)
  Cassanity::Range.new(start, finish, exclusive)
end

.Removal(*args) ⇒ Object



2
3
4
# File 'lib/cassanity/removal.rb', line 2

def self.Removal(*args)
  Removal.new(*args)
end

.remove(*values) ⇒ Object

Public: Shortcut for returning a removal value for a list collection.

values - The values to remove from the list.

Returns an Cassanity::Removal instance.



105
106
107
# File 'lib/cassanity.rb', line 105

def self.remove(*values)
  Removal.new(*values)
end

.set_add(*values) ⇒ Object Also known as: sadd

Public: Shortcut for returning an addition value for a set collection.

value - The values to add to the set.

Returns an Cassanity::SetAddition instance.



114
115
116
# File 'lib/cassanity.rb', line 114

def self.set_add(*values)
  SetAddition.new(*values)
end

.set_remove(*values) ⇒ Object Also known as: sremove

Public: Shortcut for returning a removal value for a set collection.

values - The values to remove from the set.

Returns an Cassanity::SetRemoval instance.



123
124
125
# File 'lib/cassanity.rb', line 123

def self.set_remove(*values)
  SetRemoval.new(*values)
end

.SetAddition(*args) ⇒ Object



5
6
7
# File 'lib/cassanity/set_addition.rb', line 5

def self.SetAddition(*args)
  SetAddition.new(*args)
end

.SetRemoval(*args) ⇒ Object



5
6
7
# File 'lib/cassanity/set_removal.rb', line 5

def self.SetRemoval(*args)
  SetRemoval.new(*args)
end