Class: CassandraModel::TableDescriptor
- Defined in:
- lib/cassandra_model/table_descriptor.rb
Instance Attribute Summary
Attributes inherited from Record
#attributes, #execution_info, #valid
Attributes included from Scopes
Class Method Summary collapse
- .create(table_definition) ⇒ Object
- .create_async(table_definition) ⇒ Object
- .create_descriptor_table ⇒ Object
- .drop_descriptor_table ⇒ Object
Methods inherited from Record
#==, batch_type, before_save, before_save_callbacks, cassandra_columns, #clustering_columns, columns, composite_defaults, connection_name=, #delete, #delete_async, denormalized_column_map, first, first_async, #initialize, #inspect, #invalidate!, normalized_attributes, normalized_column, order_by_clause, #partition_key, #primary_key, query_for_delete, query_for_save, query_for_update, request, request_async, request_meta, restriction_attributes, #save, #save_async, save_in_batch, select_column, select_columns, shard, shard_key, table, table=, table_name=, #update, #update_async
Methods included from Scopes
Methods included from QueryHelper
#after, #all, #before, def_query_helper, #find_by
Methods included from RecordDebug
Methods included from DisplayableAttributes
Methods included from MetaColumns
Constructor Details
This class inherits a constructor from CassandraModel::Record
Class Method Details
.create(table_definition) ⇒ Object
11 12 13 |
# File 'lib/cassandra_model/table_descriptor.rb', line 11 def create(table_definition) create_async(table_definition).get end |
.create_async(table_definition) ⇒ Object
7 8 9 |
# File 'lib/cassandra_model/table_descriptor.rb', line 7 def create_async(table_definition) super(table_descriptor(table_definition), check_exists: true) end |
.create_descriptor_table ⇒ Object
15 16 17 |
# File 'lib/cassandra_model/table_descriptor.rb', line 15 def create_descriptor_table session.execute(table_desc.to_cql(no_id: true)) unless descriptor_table_exists? end |
.drop_descriptor_table ⇒ Object
19 20 21 |
# File 'lib/cassandra_model/table_descriptor.rb', line 19 def drop_descriptor_table session.execute("DROP TABLE #{table_name}") if descriptor_table_exists? end |