class Cassandra::Session
Sessions are used for query execution. Each session tracks its current keyspace. A session should be reused as much as possible, however it is ok to create several independent session for interacting with different keyspaces in the same application.
Inherits
Object
Extends
Forwardable
Methods
keyspace
Returns current keyspace
execute_async
(statement, options = nil)Executes a given statement and returns a future result
- 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.
execute
(statement, options = nil)A blocking wrapper around #execute_async
prepare_async
(statement, options = nil)Prepares a given statement and returns a future prepared statement
prepare
(*args)A blocking wrapper around #prepare_async
logged_batch
{|batch| … } aliased as: batchReturns a logged Statements::Batch
instance and optionally yields it to
a given block
unlogged_batch
{|batch| … }Returns a unlogged Statements::Batch
instance and optionally yields it
to a given block
counter_batch
{|batch| … }Returns a counter Statements::Batch
instance and optionally yields it
to a given block
close_async
Asynchronously closes current session
close
Synchronously closes current session
inspect
Returns a CLI-friendly session representation