Class: Upkeep::SQLGlot::MappingSchema
- Inherits:
-
Object
- Object
- Upkeep::SQLGlot::MappingSchema
- Defined in:
- lib/upkeep/sqlglot.rb
Instance Attribute Summary collapse
-
#dialect ⇒ Object
readonly
Returns the value of attribute dialect.
Instance Method Summary collapse
-
#initialize(mapping = {}, dialect: nil) ⇒ MappingSchema
constructor
A new instance of MappingSchema.
- #to_dependency_native ⇒ Object
- #to_native ⇒ Object
Constructor Details
#initialize(mapping = {}, dialect: nil) ⇒ MappingSchema
Returns a new instance of MappingSchema.
238 239 240 241 242 243 |
# File 'lib/upkeep/sqlglot.rb', line 238 def initialize(mapping = {}, dialect: nil) @dialect = Dialect.resolve(dialect) || "ansi" @mapping = deep_freeze(stringify_mapping(mapping.to_h)) @tables = flatten_tables(@mapping).freeze freeze end |
Instance Attribute Details
#dialect ⇒ Object (readonly)
Returns the value of attribute dialect.
236 237 238 |
# File 'lib/upkeep/sqlglot.rb', line 236 def dialect @dialect end |
Instance Method Details
#to_dependency_native ⇒ Object
249 250 251 |
# File 'lib/upkeep/sqlglot.rb', line 249 def to_dependency_native {tables: native_tables { "UNKNOWN" }} end |
#to_native ⇒ Object
245 246 247 |
# File 'lib/upkeep/sqlglot.rb', line 245 def to_native {tables: native_tables { |_name, data_type| data_type }} end |