Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanharan committed Jul 17, 2024
1 parent af4a195 commit 9e31bd9
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -673,12 +673,14 @@ def get_table_name(sql)

# Parses the raw table name that is used in the SQL. Table name could include database/schema/etc.
def get_raw_table_name(sql)
puts "get_raw_table_name: SQL: #{sql}"

case sql
when /^\s*(INSERT|EXEC sp_executesql N'INSERT)(\s+INTO)?\s+([^\(]+)\s*|^\s*update\s+([^\(\s]+)\s*/i
Regexp.last_match[3] || Regexp.last_match[4]
when /FROM\s+([^\(\s]+)\s*/i
Regexp.last_match[1]
end
end.strip
end

def default_constraint_name(table_name, column_name)
Expand Down

0 comments on commit 9e31bd9

Please sign in to comment.