Module: Cassie::Statements::Statement
- Extended by:
- Preparation::ClassMethods
- Includes:
- Idempotency, Idempotency::ClassMethods, Preparation, TypeHinting, TypeHinting::ClassMethods
- Included in:
- Core
- Defined in:
- lib/cassie/statements/statement.rb,
lib/cassie/statements/statement/mapping.rb,
lib/cassie/statements/statement/deleting.rb,
lib/cassie/statements/statement/ordering.rb,
lib/cassie/statements/statement/relation.rb,
lib/cassie/statements/statement/updating.rb,
lib/cassie/statements/statement/inserting.rb,
lib/cassie/statements/statement/relations.rb,
lib/cassie/statements/statement/selection.rb,
lib/cassie/statements/statement/assignment.rb,
lib/cassie/statements/statement/conditions.rb,
lib/cassie/statements/statement/assignments.rb,
lib/cassie/statements/statement/preparation.rb,
lib/cassie/statements/statement/allow_filtering.rb,
lib/cassie/statements/statement/preparation/cache.rb
Overview
Include Statement to provide support for a ‘statement` method returning a `Cassandra::Statements::Simple` statement with positional arguments.
‘type` and `table` attributes are also added, providing an extension interface for building cql and bindings for different statement types.
Defined Under Namespace
Modules: AllowFiltering, Assignments, Conditions, Deleting, Idempotency, Inserting, Limiting, Mapping, Ordering, Pagination, Preparation, Relations, Selection, TypeHinting, Updating Classes: Assignment, Invalid, Relation
Instance Attribute Summary collapse
-
#cql ⇒ Object
readonly
The CQL string portion for the statment.
-
#params ⇒ Object
readonly
The positional values portion for the statment.
Instance Method Summary collapse
- #logger ⇒ Object
-
#statement ⇒ Cassandra::Statement
A bound statment with type hint and idempotent options, ready for execution ready for execution with a [Cassandra::Session].
- #table ⇒ Object
-
#to_cql ⇒ String
A CQL string with inline parameters, representing the current statement as it would be executed in a CQL shell.
Methods included from Preparation::ClassMethods
Methods included from Idempotency::ClassMethods
#idempotent, #idempotent=, #idempotent?, #non_idempotent
Methods included from Idempotency
Methods included from TypeHinting::ClassMethods
Methods included from TypeHinting
Methods included from Preparation
Instance Attribute Details
#cql ⇒ Object (readonly)
The CQL string portion for the statment
76 77 78 79 |
# File 'lib/cassie/statements/statement.rb', line 76 def cql return @cql if defined?(@cql) "" end |
#params ⇒ Object (readonly)
The positional values portion for the statment
86 87 88 89 |
# File 'lib/cassie/statements/statement.rb', line 86 def params return @params if defined?(@params) nil end |
Instance Method Details
#logger ⇒ Object
67 68 69 |
# File 'lib/cassie/statements/statement.rb', line 67 def logger Cassie::Statements.logger end |
#statement ⇒ Cassandra::Statement
A bound statment with type hint and idempotent options, ready for execution ready for execution with a [Cassandra::Session]
45 46 47 |
# File 'lib/cassie/statements/statement.rb', line 45 def statement Cassandra::Statements::Simple.new(*build_cql_and_params, type_hints, idempotent?) end |
#table ⇒ Object
39 40 41 |
# File 'lib/cassie/statements/statement.rb', line 39 def table self.class.table end |
#to_cql ⇒ String
This CQL string does not include execution options like type hinting, idempotency, consistency level, etc – just the raw CQL instruction and values.
A CQL string with inline parameters, representing the current statement as it would be executed in a CQL shell
59 60 61 62 63 64 65 |
# File 'lib/cassie/statements/statement.rb', line 59 def to_cql if statement.respond_to?(:cql) && statement.respond_to?(:params) Cassie::Support::StatementParser.new(statement).to_cql else statement.to_s end end |