Module: IndexNode

Defined in:
lib/sql_munger/nodes.rb

Instance Method Summary collapse

Instance Method Details

#fieldsObject



67
68
69
# File 'lib/sql_munger/nodes.rb', line 67

def fields
  qualified_fields.map {|x| x.last}
end

#nameObject



71
72
73
# File 'lib/sql_munger/nodes.rb', line 71

def name
  index_name.parts.last
end

#qualified_fieldsObject



61
62
63
64
65
# File 'lib/sql_munger/nodes.rb', line 61

def qualified_fields
  parenthesised_list.qualified_identifier_list.elements.map do |node|
    node.qualified_identifier.parts
  end
end

#unique?Boolean

Returns:

  • (Boolean)


57
58
59
# File 'lib/sql_munger/nodes.rb', line 57

def unique?
  !unique.text_value.empty?
end