Skip to content

Commit

Permalink
Fix bad merge
Browse files Browse the repository at this point in the history
  • Loading branch information
mlarraz committed Jan 19, 2024
1 parent d0bf6d6 commit 49d6397
Show file tree
Hide file tree
Showing 11 changed files with 440 additions and 85 deletions.
440 changes: 440 additions & 0 deletions app/assets/javascripts/pghero/highlight.min.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions app/assets/javascripts/pghero/highlight.pack.js

This file was deleted.

12 changes: 0 additions & 12 deletions gemfiles/activerecord50.gemfile

This file was deleted.

12 changes: 0 additions & 12 deletions gemfiles/activerecord51.gemfile

This file was deleted.

12 changes: 0 additions & 12 deletions gemfiles/activerecord52.gemfile

This file was deleted.

4 changes: 0 additions & 4 deletions lib/pghero/methods/basic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,6 @@ def add_source(sql)
"#{sql} /*pghero*/"
end

def add_source(sql)
"#{sql} /*pghero*/"
end

def quote(value)
connection.quote(value)
end
Expand Down
4 changes: 0 additions & 4 deletions lib/pghero/methods/space.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,6 @@ def clean_space_stats(before: nil)
PgHero::SpaceStats.where(database: id).where("captured_at < ?", before).delete_all
end

def clean_space_stats
PgHero::SpaceStats.where(database: id).where("captured_at < ?", 90.days.ago).delete_all
end

def space_stats_enabled?
table_exists?("pghero_space_stats")
end
Expand Down
31 changes: 0 additions & 31 deletions lib/pghero/methods/suggested_indexes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -266,17 +266,6 @@ def row_estimates(stats, total_rows, rows_left, op)
end
end

def parse_table_v2(tree)
case tree.node
when :select_stmt
tree.select_stmt.from_clause.first.range_var.relname
when :delete_stmt
tree.delete_stmt.relation.relname
when :update_stmt
tree.update_stmt.relation.relname
end
end

def parse_table(tree)
case tree.node
when :select_stmt
Expand All @@ -288,26 +277,6 @@ def parse_table(tree)
end
end

# TODO capture values
def parse_where_v2(tree)
aexpr = tree.a_expr

if tree.bool_expr
if tree.bool_expr.boolop == :AND_EXPR
tree.bool_expr.args.flat_map { |v| parse_where_v2(v) }
else
raise "Not Implemented"
end
elsif aexpr && ["=", "<>", ">", ">=", "<", "<=", "~~", "~~*", "BETWEEN"].include?(aexpr.name.first.string.str)
[{column: aexpr.lexpr.column_ref.fields.last.string.str, op: aexpr.name.first.string.str}]
elsif tree.null_test
op = tree.null_test.nulltesttype == :IS_NOT_NULL ? "not_null" : "null"
[{column: tree.null_test.arg.column_ref.fields.last.string.str, op: op}]
else
raise "Not Implemented"
end
end

# TODO capture values
def parse_where(tree)
aexpr = tree.a_expr
Expand Down
1 change: 0 additions & 1 deletion test/controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ def test_explain_visualize_normalized
end
end

>>>>>>> master
def test_tune
get pg_hero.tune_path
assert_response :success
Expand Down
4 changes: 0 additions & 4 deletions test/indexes_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,8 @@ def test_reset_stats
end

def test_last_stats_reset_time
<<<<<<< HEAD
assert database.last_stats_reset_time
=======
database.last_stats_reset_time
assert true
>>>>>>> master
end

def test_invalid_indexes
Expand Down
3 changes: 0 additions & 3 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ def explain_normalized?

Combustion.path = "test/internal"
Combustion.initialize! :active_record, :action_controller do
<<<<<<< HEAD
=======
config.load_defaults Rails::VERSION::STRING.to_f
>>>>>>> master
config.action_controller.logger = logger
config.active_record.logger = logger
end
Expand Down

0 comments on commit 49d6397

Please sign in to comment.