push @parts, [ $self->_insert_returning($options) ];
}
- return $self->_join_parts(' ', @parts);
+ return $self->join_clauses(' ', @parts);
}
sub _expand_insert_values {
my @parts = grep length($_->[0]), map [ $self->render_aqt($_) ], @$args;
return '' unless @parts;
return @{$parts[0]} if @parts == 1;
- my ($sql, @bind) = $self->_join_parts(' '.$self->_sqlcase($op).' ', @parts);
+ my ($sql, @bind) = $self->join_clauses(' '.$self->_sqlcase($op).' ', @parts);
return '( '.$sql.' )', @bind;
}
? ', '
: ' '.$self->_sqlcase(join ' ', split '_', $op).' '
);
- return $self->_join_parts($join, @parts);
+ return $self->join_clauses($join, @parts);
}
-sub _join_parts {
+sub join_clauses {
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_parts(' ', @parts);
+ my ($sql, @bind) = $self->join_clauses(' ', @parts);
return (
(our $Render_Top_Level ? $sql : '('.$sql.')'),
@bind
sub _render_values {
my ($self, $values) = @_;
- my ($v_sql, @bind) = $self->_join_parts(
+ my ($v_sql, @bind) = $self->join_clauses(
', ',
map [ $self->render_aqt($_) ],
ref($values) eq 'ARRAY' ? @$values : $values
sub _render_from_list {
my ($self, $list) = @_;
- return $self->_join_parts(', ', map [ $self->render_aqt($_) ], @$list);
+ return $self->join_clauses(', ', map [ $self->render_aqt($_) ], @$list);
}
sub _render_join {
[ $self->render_aqt($args->{using}) ],
) : ()),
);
- return $self->_join_parts(' ', @parts);
+ return $self->join_clauses(' ', @parts);
}
sub _expand_op_as {
sub _render_as {
my ($self, $args) = @_;
my ($thing, $as, @cols) = @$args;
- return $self->_join_parts(
+ return $self->join_clauses(
' ',
[ $self->render_aqt($thing) ],
[ $self->render_aqt({ -keyword => 'as' }) ],
(@cols
- ? [ $self->_join_parts('',
+ ? [ $self->join_clauses('',
[ $self->render_aqt($as) ],
[ '(' ],
- [ $self->_join_parts(
+ [ $self->join_clauses(
', ',
map [ $self->render_aqt($_) ], @cols
) ],