push @parts, [ $self->_insert_returning($options) ];
}
- return $self->join_clauses(' ', @parts);
+ return $self->join_query_parts(' ', @parts);
}
sub _expand_insert_values {
my @parts = map [ $self->render_aqt($_) ], @$args;
return '' unless @parts;
return @{$parts[0]} if @parts == 1;
- my ($sql, @bind) = $self->join_clauses(' '.$self->_sqlcase($op).' ', @parts);
+ my ($sql, @bind) = $self->join_query_parts(' '.$self->_sqlcase($op).' ', @parts);
return '( '.$sql.' )', @bind;
}
? ', '
: ' '.$self->_sqlcase(join ' ', split '_', $op).' '
);
- return $self->join_clauses($join, @parts);
+ return $self->join_query_parts($join, @parts);
}
-sub join_clauses {
+sub join_query_parts {
my ($self, $join, @parts) = @_;
return (
join($join, map $_->[0], @parts),
next unless defined($sql) and length($sql);
push @parts, \@part;
}
- my ($sql, @bind) = $self->join_clauses(' ', @parts);
+ my ($sql, @bind) = $self->join_query_parts(' ', @parts);
return (
(our $Render_Top_Level ? $sql : '('.$sql.')'),
@bind
sub _render_values {
my ($self, undef, $values) = @_;
- my ($v_sql, @bind) = $self->join_clauses(
+ my ($v_sql, @bind) = $self->join_query_parts(
', ',
map [ $self->render_aqt($_) ],
ref($values) eq 'ARRAY' ? @$values : $values
$self->renderer($_ => sub {
my ($self, $setop, $args) = @_;
- $self->join_clauses(
+ $self->join_query_parts(
' '.$self->format_keyword(join '_', $setop, ($args->{type}||())).' ',
map [ $self->render_aqt($_) ], @{$args->{queries}}
);
$self->clause_expander('select.with_recursive', $with_expander);
$self->clause_renderer('select.with' => sub {
my ($self, undef, $with) = @_;
- my $q_part = [ $self->join_clauses(', ',
+ my $q_part = [ $self->join_query_parts(', ',
map {
my ($alias, $query) = @$_;
- [ $self->join_clauses(' ',
+ [ $self->join_query_parts(' ',
[ $self->_render_alias($alias) ],
[ $self->format_keyword('as') ],
[ $self->render_aqt($query) ],
) ]
} @{$with->{queries}}
) ];
- return $self->join_clauses(' ',
+ return $self->join_query_parts(' ',
[ $self->format_keyword(join '_', 'with', ($with->{type}||'')) ],
$q_part,
);
sub _render_from_list {
my ($self, undef, $list) = @_;
- return $self->join_clauses(', ', map [ $self->render_aqt($_) ], @$list);
+ return $self->join_query_parts(', ', map [ $self->render_aqt($_) ], @$list);
}
sub _render_join {
[ $self->render_aqt($args->{using}) ],
) : ()),
);
- return $self->join_clauses(' ', @parts);
+ return $self->join_query_parts(' ', @parts);
}
sub _expand_op_as {
sub _render_as {
my ($self, undef, $args) = @_;
my ($thing, @alias) = @$args;
- return $self->join_clauses(
+ return $self->join_query_parts(
' ',
[ $self->render_aqt($thing) ],
[ $self->format_keyword('as') ],
my ($self, $args) = @_;
my ($as, @cols) = @$args;
return (@cols
- ? $self->join_clauses('',
+ ? $self->join_query_parts('',
[ $self->render_aqt($as) ],
[ '(' ],
- [ $self->join_clauses(
+ [ $self->join_query_parts(
', ',
map [ $self->render_aqt($_) ], @cols
) ],