class QueryBuilder::CQL::Contexts::Keyspace
Describes the Cassandra keyspace
Public Instance Methods
Returns the aggregate context
@param [#to_s] name
@return [QueryBuilder::CQL::Contexts::Aggregate]
# File lib/query_builder/cql/contexts/keyspace.rb, line 57 def aggregate(name) Aggregate.new(keyspace: self, name: name) end
Builds the ‘ALTER KEYSPACE’ CQL
statement for the current keyspace
@return [QueryBuilder::CQL::Statements::AlterKeyspace]
# File lib/query_builder/cql/contexts/keyspace.rb, line 83 def alter Statements::AlterKeyspace.new(context: self) end
Builds the ‘CREATE KEYSPACE’ CQL
statement for the current keyspace
@return [QueryBuilder::Statements::CreateKeyspace]
# File lib/query_builder/cql/contexts/keyspace.rb, line 75 def create Statements::CreateKeyspace.new(context: self) end
Builds the ‘DROP KEYSPACE’ CQL
statement for the current keyspace
@return [QueryBuilder::CQL::Statements::DropKeyspace]
# File lib/query_builder/cql/contexts/keyspace.rb, line 91 def drop Statements::DropKeyspace.new(context: self) end
Returns the function context
@param [#to_s] name
@return [QueryBuilder::CQL::Contexts::Function]
# File lib/query_builder/cql/contexts/keyspace.rb, line 47 def function(name) Function.new(keyspace: self, name: name) end
Returns the context of Cassandra keyspace permission
@param [#to_s, nil] name The name of the permission
@param [QueryBuilder::CQL::Contexts::Permission]
# File lib/query_builder/cql/contexts/keyspace.rb, line 67 def permission(name = nil) Contexts::Permission.new(keyspace: self, name: name) end
Returns the table context
@param [#to_s] name
@return [QueryBuilder::CQL::Contexts::Table]
# File lib/query_builder/cql/contexts/keyspace.rb, line 27 def table(name) Table.new(keyspace: self, name: name) end
Returns the name of the keyspace
@return [String]
# File lib/query_builder/cql/contexts/keyspace.rb, line 17 def to_s name.to_s end
Returns the type context
@param [#to_s] name
@return [QueryBuilder::CQL::Contexts::Type]
# File lib/query_builder/cql/contexts/keyspace.rb, line 37 def type(name) Type.new(keyspace: self, name: name) end
Builds the ‘USE’ CQL
statement
@return [QueryBuilder::Statements::Use]
# File lib/query_builder/cql/contexts/keyspace.rb, line 99 def use Statements::Use.new(context: self) end