Batch statement groups several Statement. There are several types of Batch statements available:

See Also:

Inherits

Object

Includes

Methods

add

(statement, options = nil)

Adds a statement to this batch.

Note
Positional arguments for simple statements are only supported starting with Apache Cassandra 2.0 and above.
Note
Named arguments for simple statements are only supported starting with Apache Cassandra 2.1 and above.
Parameters:
Name Type Details
statement (String, Statements::Simple, Statements::Prepared or Statements::Bound) statement to add.
options Hash (defaults to: nil) (nil) a customizable set of options
Keys for options:
Key Type Details
:arguments (Array or Hash) default: nil positional or named arguments to bind, must contain the same number of parameters as the number of positional (?) or named (:name) markers in the CQL passed.
:type_hints (Array or Hash) default: nil override Util.guess_type to determine the CQL type for an argument; nil elements will fall-back to Util.guess_type.
:idempotent Boolean default: false specify whether this statement can be retried safely on timeout.
Returns:
Type Details
self

idempotent?

Determines whether or not the statement is safe to retry on timeout Batches are idempotent only when all statements in a batch are.

Returns:
Type Details
Boolean whether the statement is safe to retry on timeout

cql

A batch statement doesn’t really have any cql of its own as it is composed of multiple different statements

Returns:
Type Details
nil nothing

type

Returns one of :logged, :unlogged or :counter

Returns:
Type Details
Symbol one of :logged, :unlogged or :counter

inspect

Returns a CLI-friendly batch statement representation

Returns:
Type Details
String a CLI-friendly batch statement representation