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

Deparse BETWEEN. #55

Merged
merged 2 commits into from
Oct 6, 2016
Merged

Deparse BETWEEN. #55

merged 2 commits into from
Oct 6, 2016

Conversation

jcsjcs
Copy link
Contributor

@jcsjcs jcsjcs commented Oct 6, 2016

Deparsing changes to manage BETWEEN, NOT BETWEEN, BETWEEN SYMMETRIC and NOT BETWEEN SYMMETRIC.

@@ -377,6 +379,22 @@ def deparse_aexpr_any(node)
output.join(' ' + deparse_item(node['name'][0], :operator) + ' ')
end

def deparse_aexpr_between(node)
between = case node['kind']
when AEXPR_BETWEEN
Copy link
Member

@lfittl lfittl Oct 6, 2016

Choose a reason for hiding this comment

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

C: Indent when as deep as case.
      when AEXPR_BETWEEN
      ^^^^

Per our current style guidelines (enforced by rubocop) this would have to be indented as deep as the case keyword. Same goes for the other ones below.

' NOT BETWEEN SYMMETRIC '
end
name = deparse_item(node['lexpr'])
output = node['rexpr'].map {|n| deparse_item(n) }
Copy link
Member

Choose a reason for hiding this comment

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

lib/pg_query/deparse.rb:394:34: C: Space between { and | missing.
      output = node['rexpr'].map {|n| deparse_item(n) }

@lfittl lfittl merged commit faba120 into pganalyze:master Oct 6, 2016
@jcsjcs jcsjcs deleted the deparse_between branch October 7, 2016 09:32
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.

2 participants