helpers/dataminer_helpers.rb
# Add newlines to SQL before certain keywords.
#
# @param sql [String] the sql.
# @return [String] SQL with newlines injected where appropriate.
Add newlines to SQL before certain keywords.
Add newlines to SQL before certain keywords .
def sql_add_newlines(sql)
    key_phrases = ['left outer join',
                   'left join ',
                   'inner join ',
                   'join ',
                   'order by ',
                   'group by '].join('|')
    sql.gsub(/(#{key_phrases})/i, "\n\\1")
  end
def sql_add_newlines ( sql ) key_phrases = [ 'left outer join' , 'left join ' , 'inner join ' , 'join ' , 'order by ' , 'group by ' ] . join ( '|' ) sql . gsub ( / ( #{ key_phrases } ) /i , "\n\\1" ) end
Add newlines to SQL before certain keywords.
Add newlines to SQL before certain keywords .
SQL with newlines injected where appropriate.
SQL with newlines injected where appropriate .
String
sql
None