Module: ElasticGraph::Warehouse::SchemaDefinition::ScalarTypeExtension
- Defined in:
- elasticgraph-warehouse/lib/elastic_graph/warehouse/schema_definition/scalar_type_extension.rb
Overview
Extends SchemaDefinition::SchemaElements::ScalarType to add warehouse column type conversion.
Instance Attribute Summary collapse
-
#warehouse_column_type ⇒ Object
readonly
Warehouse column type configured on this scalar type.
Instance Method Summary collapse
-
#to_warehouse_column_type ⇒ String
Returns the warehouse column type representation for this scalar type.
-
#warehouse_column(type:) ⇒ String
Configures warehouse column type for this scalar type.
Instance Attribute Details
#warehouse_column_type ⇒ Object (readonly)
Warehouse column type configured on this scalar type.
18 19 20 |
# File 'elasticgraph-warehouse/lib/elastic_graph/warehouse/schema_definition/scalar_type_extension.rb', line 18 def warehouse_column_type @warehouse_column_type end |
Instance Method Details
#to_warehouse_column_type ⇒ String
Note:
Built-in ElasticGraph scalar types are automatically configured with appropriate warehouse column types.
Custom scalar types must explicitly call warehouse_column to specify their warehouse type.
Returns the warehouse column type representation for this scalar type.
34 35 36 37 |
# File 'elasticgraph-warehouse/lib/elastic_graph/warehouse/schema_definition/scalar_type_extension.rb', line 34 def to_warehouse_column_type warehouse_column_type || raise(Errors::SchemaError, "Warehouse column type not configured for scalar type `#{name}`. " \ 'To proceed, call `warehouse_column type: "TYPE"` on the scalar type definition.') end |
#warehouse_column(type:) ⇒ String
Configures warehouse column type for this scalar type.
24 25 26 |
# File 'elasticgraph-warehouse/lib/elastic_graph/warehouse/schema_definition/scalar_type_extension.rb', line 24 def warehouse_column(type:) @warehouse_column_type = type end |