7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/rack/dev_insight/extractor.rb', line 7
def (dialect_name, statement)
crud_tables = SqlInsight.(dialect_name, statement)
results = { 'CREATE' => [], 'READ' => [], 'UPDATE' => [], 'DELETE' => [] }
crud_tables.each do |crud_table|
results['CREATE'].concat(crud_table.create_tables.map(&:name).map(&:value))
results['READ'].concat(crud_table.read_tables.map(&:name).map(&:value))
results['UPDATE'].concat(crud_table.update_tables.map(&:name).map(&:value))
results['DELETE'].concat(crud_table.delete_tables.map(&:name).map(&:value))
end
results
end
|