class QueryBuilder::CQL::Contexts::Column

Describes the Cassandra table column

Public Instance Methods

alter(type) click to toggle source

Builds the ‘ALTER TABLE … ALTER’ CQL statement

@param [#to_s] type

@return [QueryBuilder::Statements::AlterColumn]

# File lib/query_builder/cql/contexts/column.rb, line 43
def alter(type)
  Statements::AlterColumn.new(context: self, type: type)
end
create(type, options = {}) click to toggle source

Builds the ‘ALTER TABLE … ADD’ CQL statement

@param [#to_s] type @param [Hash] options @option options [Boolean] :static

@return [QueryBuilder::Statements::AddColumn]

# File lib/query_builder/cql/contexts/column.rb, line 22
def create(type, options = {})
  Statements::CreateColumn
    .new(context: self, type: type, static: options[:static])
end
drop() click to toggle source

Builds the ‘ALTER TABLE … DROP’ CQL statement

@return [QueryBuilder::Statements::DropColumn]

# File lib/query_builder/cql/contexts/column.rb, line 51
def drop
  Statements::DropColumn.new(context: self)
end
rename(name) click to toggle source

Builds the ‘ALTER TABLE … RENAME’ CQL statement

@param [#to_s] name

@return [QueryBuilder::Statements::RenameColumn]

# File lib/query_builder/cql/contexts/column.rb, line 33
def rename(name)
  Statements::RenameColumn.new(context: self, name: name)
end