Class: QueryBuilder::CQL::Contexts::Index

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

Overview

Describes the Cassandra table index

Instance Method Summary collapse

Instance Method Details

#create(*options) ⇒ QueryBuilder::Statements::CreateIndex

Builds the ‘CREATE INDEX’ CQL statement for the current table

Parameters:

  • options (Hash)

Returns:

  • (QueryBuilder::Statements::CreateIndex)


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

def create(*options)
  Statements::CreateIndex.new(context: self).add(options)
end

#dropQueryBuilder::Statements::DropIndex

Builds the ‘DROP INDEX’ CQL statement

Returns:

  • (QueryBuilder::Statements::DropIndex)


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

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

#to_s<type>

<description>

Returns:

  • (<type>)

    <description>



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

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