Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find tables in case statements #235

Merged
merged 2 commits into from
Nov 12, 2021

Conversation

Tassosb
Copy link
Contributor

@Tassosb Tassosb commented Nov 11, 2021

No description provided.

Copy link
Contributor

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is cool!

@@ -264,6 +264,10 @@ def load_objects! # rubocop:disable Metrics/CyclomaticComplexity
function: next_item.func_call.funcname.map { |f| f.string.str }.join('.'),
type: :call
}
when :case_expr
subselect_items.concat(next_item.case_expr.args.map { |arg| arg.case_when.expr })
subselect_items.concat(next_item.case_expr.args.map { |arg| arg.case_when.result })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: I got curious if the creation of an intermediary Array here was less efficient than <<ing many times onto subselect_items.

In all: Cool feature addition!

@lfittl lfittl merged commit 1266380 into pganalyze:main Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants