Class: QueryBuilder::CQL::Contexts::Table
- Defined in:
- lib/query_builder/cql/contexts/table.rb
Overview
Describes the Cassandra table
Instance Method Summary collapse
-
#alter(options) ⇒ QueryBuilder::Statements::AlterTable
Builds the ‘ALTER TABLE’ CQL statement to modify properties (WITH).
-
#column(name) ⇒ QueryBuilder::CQL::Contexts::Column
Returns the column context.
-
#create ⇒ QueryBuilder::Statements::CreateTable
Builds the ‘CREATE TABLE’ CQL statement.
-
#delete(*columns) ⇒ QueryBuilder::Statements::Delete
Builds the ‘DELETE’ CQL statement.
-
#drop ⇒ QueryBuilder::Statements::DropTable
Builds the ‘DROP TABLE’ CQL statement.
-
#index(name = nil) ⇒ QueryBuilder::CQL::Contexts::Index
Returns the index context.
-
#insert(options = {}) ⇒ QueryBuilder::Statements::Insert
Builds the ‘INSERT’ CQL statement.
-
#permission(name = nil) ⇒ Object
Returns the context of Cassandra table permission.
-
#select(*values) ⇒ QueryBuilder::Statements::Insert
Builds the ‘SELECT’ CQL statement.
-
#to_s ⇒ String
Returns the full name of the table.
-
#trigger(name) ⇒ QueryBuilder::CQL::Contexts::Trigger
Returns the trigger context.
-
#truncate ⇒ QueryBuilder::Statements::Truncate
Builds the ‘TRUNCATE’ CQL statement.
-
#update(options = {}) ⇒ QueryBuilder::Statements::Update
Builds the ‘UPDATE’ CQL statement.
Instance Method Details
#alter(options) ⇒ QueryBuilder::Statements::AlterTable
Builds the ‘ALTER TABLE’ CQL statement to modify properties (WITH)
76 77 78 |
# File 'lib/query_builder/cql/contexts/table.rb', line 76 def alter() Statements::AlterTable.new(context: self).alter() end |
#column(name) ⇒ QueryBuilder::CQL::Contexts::Column
Returns the column context
48 49 50 |
# File 'lib/query_builder/cql/contexts/table.rb', line 48 def column(name) Column.new(table: self, name: name) end |
#create ⇒ QueryBuilder::Statements::CreateTable
Builds the ‘CREATE TABLE’ CQL statement
66 67 68 |
# File 'lib/query_builder/cql/contexts/table.rb', line 66 def create Statements::CreateTable.new(context: self) end |
#delete(*columns) ⇒ QueryBuilder::Statements::Delete
Builds the ‘DELETE’ CQL statement
124 125 126 |
# File 'lib/query_builder/cql/contexts/table.rb', line 124 def delete(*columns) Statements::Delete.new(context: self).delete(*columns) end |
#drop ⇒ QueryBuilder::Statements::DropTable
Builds the ‘DROP TABLE’ CQL statement
84 85 86 |
# File 'lib/query_builder/cql/contexts/table.rb', line 84 def drop Statements::DropTable.new(context: self) end |
#index(name = nil) ⇒ QueryBuilder::CQL::Contexts::Index
Returns the index context
28 29 30 |
# File 'lib/query_builder/cql/contexts/table.rb', line 28 def index(name = nil) Index.new(table: self, name: name) end |
#insert(options = {}) ⇒ QueryBuilder::Statements::Insert
Builds the ‘INSERT’ CQL statement
94 95 96 |
# File 'lib/query_builder/cql/contexts/table.rb', line 94 def insert( = {}) Statements::Insert.new(context: self).insert() end |
#permission(name = nil) ⇒ Object
Returns the context of Cassandra table permission
58 59 60 |
# File 'lib/query_builder/cql/contexts/table.rb', line 58 def (name = nil) Contexts::Permission.new(table: self, name: name) end |
#select(*values) ⇒ QueryBuilder::Statements::Insert
Builds the ‘SELECT’ CQL statement
104 105 106 |
# File 'lib/query_builder/cql/contexts/table.rb', line 104 def select(*values) Statements::Select.new(context: self).select(*values) end |
#to_s ⇒ String
Returns the full name of the table
18 19 20 |
# File 'lib/query_builder/cql/contexts/table.rb', line 18 def to_s [keyspace, name].join(".") end |
#trigger(name) ⇒ QueryBuilder::CQL::Contexts::Trigger
Returns the trigger context
38 39 40 |
# File 'lib/query_builder/cql/contexts/table.rb', line 38 def trigger(name) Trigger.new(table: self, name: name) end |
#truncate ⇒ QueryBuilder::Statements::Truncate
Builds the ‘TRUNCATE’ CQL statement
132 133 134 |
# File 'lib/query_builder/cql/contexts/table.rb', line 132 def truncate Statements::Truncate.new(context: self) end |
#update(options = {}) ⇒ QueryBuilder::Statements::Update
Builds the ‘UPDATE’ CQL statement
114 115 116 |
# File 'lib/query_builder/cql/contexts/table.rb', line 114 def update( = {}) Statements::Update.new(context: self).update() end |