class Cassandra::DBApi::Session
- Cassandra::DBApi::Session
- DB::Connection
- Reference
- Object
Overview
Represents a Cassandra session, establishes the actual connection to Cassandra.
Defined in:
cassandra/dbapi/session.crConstructors
-
.new(context : DB::ConnectionContext)
Creates a
Session
object and initiates a Cassandra cluster.
Instance Method Summary
-
#build_prepared_statement(query) : DB::Statement
Creates a prepared statement from a query.
-
#build_unprepared_statement(query) : DB::Statement
Creates an unprepared (one-off) statement from a query.
-
#do_close
Close the session.
Constructor Detail
Creates a Session
object and initiates a Cassandra cluster.
Instance Method Detail
Creates a prepared statement from a query.
The statement is bound to a session and can be executed.
Creates an unprepared (one-off) statement from a query.
The statement is bound to a session and can be executed.
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.