class Cassandra::DBApi::Session

Overview

Represents a Cassandra session, establishes the actual connection to Cassandra.

Defined in:

cassandra/dbapi/session.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(context : DB::ConnectionContext) #

Creates a Session object and initiates a Cassandra cluster.


[View source]

Instance Method Detail

def build_prepared_statement(query) : DB::Statement #

Creates a prepared statement from a query.

The statement is bound to a session and can be executed.


[View source]
def build_unprepared_statement(query) : DB::Statement #

Creates an unprepared (one-off) statement from a query.

The statement is bound to a session and can be executed.


[View source]
def do_close #

Close the session.

Closes the Cassandra session and frees memory. Also invokes cluster disposal which will actually happen if this cluster reference is the last one for that cluster. Needs to be called to prevent connection and memory leaks.


[View source]