Class: ActiveRecordSpannerAdapter::Table
- Inherits:
-
Object
- Object
- ActiveRecordSpannerAdapter::Table
- Defined in:
- lib/activerecord_spanner_adapter/table.rb,
lib/activerecord_spanner_adapter/table/column.rb
Defined Under Namespace
Classes: Column
Instance Attribute Summary collapse
-
#catalog ⇒ Object
Returns the value of attribute catalog.
-
#columns ⇒ Object
Returns the value of attribute columns.
-
#foreign_keys ⇒ Object
Returns the value of attribute foreign_keys.
-
#indexes ⇒ Object
Returns the value of attribute indexes.
-
#name ⇒ Object
Returns the value of attribute name.
-
#on_delete ⇒ Object
Returns the value of attribute on_delete.
-
#parent_table ⇒ Object
Returns the value of attribute parent_table.
-
#schema_name ⇒ Object
Returns the value of attribute schema_name.
Instance Method Summary collapse
- #cascade? ⇒ Boolean
-
#initialize(name, parent_table: nil, on_delete: nil, schema_name: nil, catalog: nil) ⇒ Table
constructor
parent_table == interleave_in.
- #primary_keys ⇒ Object
Constructor Details
#initialize(name, parent_table: nil, on_delete: nil, schema_name: nil, catalog: nil) ⇒ Table
parent_table == interleave_in
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/activerecord_spanner_adapter/table.rb', line 37 def initialize \ name, parent_table: nil, on_delete: nil, schema_name: nil, catalog: nil @name = name.to_s @parent_table = parent_table.to_s if parent_table @on_delete = on_delete @schema_name = schema_name @catalog = catalog @columns = [] @indexes = [] @foreign_keys = [] end |
Instance Attribute Details
#catalog ⇒ Object
Returns the value of attribute catalog.
33 34 35 |
# File 'lib/activerecord_spanner_adapter/table.rb', line 33 def catalog @catalog end |
#columns ⇒ Object
Returns the value of attribute columns.
33 34 35 |
# File 'lib/activerecord_spanner_adapter/table.rb', line 33 def columns @columns end |
#foreign_keys ⇒ Object
Returns the value of attribute foreign_keys.
33 34 35 |
# File 'lib/activerecord_spanner_adapter/table.rb', line 33 def foreign_keys @foreign_keys end |
#indexes ⇒ Object
Returns the value of attribute indexes.
33 34 35 |
# File 'lib/activerecord_spanner_adapter/table.rb', line 33 def indexes @indexes end |
#name ⇒ Object
Returns the value of attribute name.
33 34 35 |
# File 'lib/activerecord_spanner_adapter/table.rb', line 33 def name @name end |
#on_delete ⇒ Object
Returns the value of attribute on_delete.
33 34 35 |
# File 'lib/activerecord_spanner_adapter/table.rb', line 33 def on_delete @on_delete end |
#parent_table ⇒ Object
Returns the value of attribute parent_table.
33 34 35 |
# File 'lib/activerecord_spanner_adapter/table.rb', line 33 def parent_table @parent_table end |
#schema_name ⇒ Object
Returns the value of attribute schema_name.
33 34 35 |
# File 'lib/activerecord_spanner_adapter/table.rb', line 33 def schema_name @schema_name end |
Instance Method Details
#cascade? ⇒ Boolean
57 58 59 |
# File 'lib/activerecord_spanner_adapter/table.rb', line 57 def cascade? @on_delete == "CASCADE" end |
#primary_keys ⇒ Object
53 54 55 |
# File 'lib/activerecord_spanner_adapter/table.rb', line 53 def primary_keys columns.select(&:primary_key).map(&:name) end |