Class: Cassie::Schema::CreateKeyspaceQuery
- Inherits:
-
Definition
- Object
- Definition
- Cassie::Schema::CreateKeyspaceQuery
- Defined in:
- lib/cassie/schema/queries/create_keyspace_query.rb
Instance Attribute Summary collapse
-
#durable_writes ⇒ Object
Returns the value of attribute durable_writes.
-
#name ⇒ Object
Returns the value of attribute name.
-
#replication_class ⇒ Object
Returns the value of attribute replication_class.
-
#replication_factor ⇒ Object
Returns the value of attribute replication_factor.
Attributes included from Cassie::Statements::Execution::ClassMethods
Attributes included from Cassie::Statements::Statement
Instance Method Summary collapse
-
#initialize(*args) ⇒ CreateKeyspaceQuery
constructor
A new instance of CreateKeyspaceQuery.
- #statement ⇒ Object
Methods included from Cassie::Statements::Execution::ClassMethods
Methods included from Cassie::Statements::Execution
#execute, #execute!, #execution_options
Methods included from Cassie::Statements::Execution::Instrumentation
Methods included from Cassie::Statements::Execution::PartitionLinking
#build_partition_linker, #execute, #partition_linker?
Methods included from Cassie::Statements::Execution::Callbacks
Methods included from Cassie::Statements::Execution::Consistency
Methods included from Cassie::Statements::Statement
Methods included from Cassie::Statements::Statement::Preparation::ClassMethods
#prepare, #prepare=, #prepare?
Methods included from Cassie::Statements::Statement::Idempotency::ClassMethods
#idempotent, #idempotent=, #idempotent?, #non_idempotent
Methods included from Cassie::Statements::Statement::Idempotency
Methods included from Cassie::Statements::Statement::TypeHinting::ClassMethods
Methods included from Cassie::Statements::Statement::TypeHinting
Methods included from Cassie::Statements::Statement::Preparation
Methods included from Connection
Methods included from Connection::ClassMethods
Constructor Details
#initialize(*args) ⇒ CreateKeyspaceQuery
Returns a new instance of CreateKeyspaceQuery.
11 12 13 14 15 16 |
# File 'lib/cassie/schema/queries/create_keyspace_query.rb', line 11 def initialize(*args) super(*args) @replication_class ||= 'SimpleStrategy' @replication_factor ||= 1 @durable_writes = true unless defined?(@durable_writes) end |
Instance Attribute Details
#durable_writes ⇒ Object
Returns the value of attribute durable_writes.
6 7 8 |
# File 'lib/cassie/schema/queries/create_keyspace_query.rb', line 6 def durable_writes @durable_writes end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/cassie/schema/queries/create_keyspace_query.rb', line 6 def name @name end |
#replication_class ⇒ Object
Returns the value of attribute replication_class.
6 7 8 |
# File 'lib/cassie/schema/queries/create_keyspace_query.rb', line 6 def replication_class @replication_class end |
#replication_factor ⇒ Object
Returns the value of attribute replication_factor.
6 7 8 |
# File 'lib/cassie/schema/queries/create_keyspace_query.rb', line 6 def replication_factor @replication_factor end |
Instance Method Details
#statement ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/cassie/schema/queries/create_keyspace_query.rb', line 18 def statement cql = %( CREATE KEYSPACE IF NOT EXISTS #{name} WITH replication = {'class': '#{replication_class}', 'replication_factor': '#{replication_factor}'} AND durable_writes = #{!!durable_writes}; ) end |