From: Matt S Trout Date: Thu, 18 Apr 2019 01:23:49 +0000 (+0000) Subject: take advantage of join_query_parts to clean up X-Git-Tag: v1.90_01~188 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a1f8b6efc03e9f71c39835fe9ae083fc3e386904;p=dbsrgits%2FSQL-Abstract.git take advantage of join_query_parts to clean up --- diff --git a/lib/SQL/Abstract/Clauses.pm b/lib/SQL/Abstract/Clauses.pm index d404077..87aa4e1 100644 --- a/lib/SQL/Abstract/Clauses.pm +++ b/lib/SQL/Abstract/Clauses.pm @@ -270,8 +270,7 @@ sub _render_values { my ($self, undef, $values) = @_; my ($v_sql, @bind) = $self->join_query_parts( ', ', - map [ $self->render_aqt($_) ], - ref($values) eq 'ARRAY' ? @$values : $values + ref($values) eq 'ARRAY' ? @$values : $values ); my $sql = $self->_sqlcase('values').' '.$v_sql; return ( diff --git a/lib/SQL/Abstract/ExtraClauses.pm b/lib/SQL/Abstract/ExtraClauses.pm index 9878941..0ab5a9c 100644 --- a/lib/SQL/Abstract/ExtraClauses.pm +++ b/lib/SQL/Abstract/ExtraClauses.pm @@ -94,7 +94,7 @@ sub register_defaults { my ($self, $setop, $args) = @_; $self->join_query_parts( ' '.$self->format_keyword(join '_', $setop, ($args->{type}||())).' ', - map [ $self->render_aqt($_) ], @{$args->{queries}} + @{$args->{queries}} ); }) for qw(union intersect except); @@ -146,7 +146,7 @@ sub register_defaults { [ $self->join_query_parts(' ', [ $self->_render_alias($alias) ], [ $self->format_keyword('as') ], - [ $self->render_aqt($query) ], + $query, ) ] } @{$with->{queries}} ) ]; @@ -215,7 +215,7 @@ sub _expand_join { sub _render_from_list { my ($self, undef, $list) = @_; - return $self->join_query_parts(', ', map [ $self->render_aqt($_) ], @$list); + return $self->join_query_parts(', ', @$list); } sub _render_join { @@ -262,11 +262,11 @@ sub _render_alias { my ($as, @cols) = @$args; return (@cols ? $self->join_query_parts('', - [ $self->render_aqt($as) ], + $as, [ '(' ], [ $self->join_query_parts( ', ', - map [ $self->render_aqt($_) ], @cols + @cols ) ], [ ')' ], )