Class: Upkeep::SQLGlot::TableRef

Inherits:
Data
  • Object
show all
Defined in:
lib/upkeep/sqlglot.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#aliasObject (readonly)

Returns the value of attribute alias

Returns:

  • (Object)

    the current value of alias



53
54
55
# File 'lib/upkeep/sqlglot.rb', line 53

def alias
  @alias
end

#alias_quote_styleObject (readonly)

Returns the value of attribute alias_quote_style

Returns:

  • (Object)

    the current value of alias_quote_style



53
54
55
# File 'lib/upkeep/sqlglot.rb', line 53

def alias_quote_style
  @alias_quote_style
end

#catalogObject (readonly)

Returns the value of attribute catalog

Returns:

  • (Object)

    the current value of catalog



53
54
55
# File 'lib/upkeep/sqlglot.rb', line 53

def catalog
  @catalog
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



53
54
55
# File 'lib/upkeep/sqlglot.rb', line 53

def name
  @name
end

#name_quote_styleObject (readonly)

Returns the value of attribute name_quote_style

Returns:

  • (Object)

    the current value of name_quote_style



53
54
55
# File 'lib/upkeep/sqlglot.rb', line 53

def name_quote_style
  @name_quote_style
end

#schemaObject (readonly)

Returns the value of attribute schema

Returns:

  • (Object)

    the current value of schema



53
54
55
# File 'lib/upkeep/sqlglot.rb', line 53

def schema
  @schema
end

Class Method Details

.from_native(value) ⇒ Object



61
62
63
64
65
66
67
68
69
70
# File 'lib/upkeep/sqlglot.rb', line 61

def self.from_native(value)
  new(
    catalog: value["catalog"],
    schema: value["schema"],
    name: value.fetch("name"),
    alias: value["alias"],
    name_quote_style: value["name_quote_style"],
    alias_quote_style: value["alias_quote_style"]
  )
end

Instance Method Details

#qualified_nameObject



72
73
74
# File 'lib/upkeep/sqlglot.rb', line 72

def qualified_name
  [catalog, schema, name].compact.reject(&:empty?).join(".")
end