class QueryBuilder::CQL::Contexts::Keyspace

Describes the Cassandra keyspace

Public Instance Methods

aggregate(name) click to toggle source

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
alter() click to toggle source

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
create() click to toggle source

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
drop() click to toggle source

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
function(name) click to toggle source

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
permission(name = nil) click to toggle source

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
table(name) click to toggle source

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
to_s() click to toggle source

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
type(name) click to toggle source

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
use() click to toggle source

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