@@ -37,18 +37,16 @@ def indexes(table_name)
37
37
data = select ( "EXEC sp_helpindex #{ quote ( table_name ) } " , "SCHEMA" ) rescue [ ]
38
38
39
39
data . reduce ( [ ] ) do |indexes , index |
40
- index = index . to_h . with_indifferent_access
41
-
42
- if index [ :index_description ] . match? ( /primary key/ )
40
+ if index [ 'index_description' ] . match? ( /primary key/ )
43
41
indexes
44
42
else
45
- name = index [ : index_name]
46
- unique = index [ : index_description] . match? ( /unique/ )
43
+ name = index [ ' index_name' ]
44
+ unique = index [ ' index_description' ] . match? ( /unique/ )
47
45
where = select_value ( "SELECT [filter_definition] FROM sys.indexes WHERE name = #{ quote ( name ) } " , "SCHEMA" )
48
46
orders = { }
49
47
columns = [ ]
50
48
51
- index [ : index_keys] . split ( "," ) . each do |column |
49
+ index [ ' index_keys' ] . split ( "," ) . each do |column |
52
50
column . strip!
53
51
54
52
if column . end_with? ( "(-)" )
@@ -504,7 +502,7 @@ def column_definitions(table_name)
504
502
results = internal_exec_query ( sql , "SCHEMA" , binds )
505
503
506
504
columns = results . map do |ci |
507
- ci = ci . to_h . symbolize_keys
505
+ ci = ci . to_h . symbolize_keys # TODO: Fix so doesnt use hash.
508
506
ci [ :_type ] = ci [ :type ]
509
507
ci [ :table_name ] = view_tblnm || table_name
510
508
ci [ :type ] = case ci [ :type ]
@@ -712,7 +710,7 @@ def view_information(table_name)
712
710
view_info = select_one "SELECT * FROM #{ information_query_table } WITH (NOLOCK) WHERE TABLE_NAME = #{ quote ( identifier . object ) } " , "SCHEMA"
713
711
714
712
if view_info
715
- view_info = view_info . to_h . with_indifferent_access
713
+ view_info = view_info . to_h . with_indifferent_access # TODO: Fix so doesnt use hash.
716
714
if view_info [ :VIEW_DEFINITION ] . blank? || view_info [ :VIEW_DEFINITION ] . length == 4000
717
715
view_info [ :VIEW_DEFINITION ] = begin
718
716
select_values ( "EXEC sp_helptext #{ identifier . object_quoted } " , "SCHEMA" ) . join
0 commit comments