Class: QueryBuilder::CQL::Contexts::Type

Inherits:
Base
  • Object
show all
Defined in:
lib/query_builder/cql/contexts/type.rb

Overview

Describes the Cassandra user-defined type

Instance Method Summary collapse

Instance Method Details

#createQueryBuilder::Statements::CreateType

Builds the ‘CREATE TYPE’ CQL statement

Returns:

  • (QueryBuilder::Statements::CreateType)


36
37
38
# File 'lib/query_builder/cql/contexts/type.rb', line 36

def create
  Statements::CreateType.new(context: self)
end

#dropQueryBuilder::Statements::DropType

Builds the ‘DROP TYPE’ CQL statement

Returns:

  • (QueryBuilder::Statements::DropType)


44
45
46
# File 'lib/query_builder/cql/contexts/type.rb', line 44

def drop
  Statements::DropType.new(context: self)
end

#field(name) ⇒ QueryBuilder::CQL::Contexts::Field

Returns the field context

Parameters:

Returns:



28
29
30
# File 'lib/query_builder/cql/contexts/type.rb', line 28

def field(name)
  Contexts::Field.new(type: self, name: name)
end

#to_sString

Returns the full name of the type

Returns:

  • (String)


18
19
20
# File 'lib/query_builder/cql/contexts/type.rb', line 18

def to_s
  [keyspace, name].join(".")
end