class QueryBuilder::CQL::Contexts::Table
Describes the Cassandra table
Public Instance Methods
Builds the ‘ALTER TABLE’ CQL
statement to modify properties (WITH)
@param [Hash] options
@return [QueryBuilder::Statements::AlterTable]
# File lib/query_builder/cql/contexts/table.rb, line 76 def alter(options) Statements::AlterTable.new(context: self).alter(options) end
Returns the column context
@param [#to_s] name
@return [QueryBuilder::CQL::Contexts::Column]
# File lib/query_builder/cql/contexts/table.rb, line 48 def column(name) Column.new(table: self, name: name) end
Builds the ‘CREATE TABLE’ CQL
statement
@return [QueryBuilder::Statements::CreateTable]
# File lib/query_builder/cql/contexts/table.rb, line 66 def create Statements::CreateTable.new(context: self) end
Builds the ‘DROP TABLE’ CQL
statement
@return [QueryBuilder::Statements::DropTable]
# File lib/query_builder/cql/contexts/table.rb, line 84 def drop Statements::DropTable.new(context: self) end
Returns the index context
@param [#to_s] name
@return [QueryBuilder::CQL::Contexts::Index]
# File lib/query_builder/cql/contexts/table.rb, line 28 def index(name = nil) Index.new(table: self, name: name) end
Builds the ‘INSERT’ CQL
statement
@param [Hash] options
@return [QueryBuilder::Statements::Insert]
# File lib/query_builder/cql/contexts/table.rb, line 94 def insert(options = {}) Statements::Insert.new(context: self).insert(options) end
Returns the context of Cassandra table permission
@param [#to_s, nil] name The name of the permission
@param [QueryBuilder::CQL::Contexts::Permission]
# File lib/query_builder/cql/contexts/table.rb, line 58 def permission(name = nil) Contexts::Permission.new(table: self, name: name) end
Builds the ‘SELECT’ CQL
statement
@param [Array<#to_s>, Hash, nil] values
@return [QueryBuilder::Statements::Insert]
# File lib/query_builder/cql/contexts/table.rb, line 104 def select(*values) Statements::Select.new(context: self).select(*values) end
Returns the full name of the table
@return [String]
# File lib/query_builder/cql/contexts/table.rb, line 18 def to_s [keyspace, name].join(".") end
Returns the trigger context
@param [#to_s] name
@return [QueryBuilder::CQL::Contexts::Trigger]
# File lib/query_builder/cql/contexts/table.rb, line 38 def trigger(name) Trigger.new(table: self, name: name) end
Builds the ‘TRUNCATE’ CQL
statement
@return [QueryBuilder::Statements::Truncate]
# File lib/query_builder/cql/contexts/table.rb, line 132 def truncate Statements::Truncate.new(context: self) end
Builds the ‘UPDATE’ CQL
statement
@param [Hash] options
@return [QueryBuilder::Statements::Update]
# File lib/query_builder/cql/contexts/table.rb, line 114 def update(options = {}) Statements::Update.new(context: self).update(options) end