}
sub _expand_insert_clause_target {
- +(target => $_[0]->_expand_maybe_list_expr($_[2], -ident));
+ +(target => $_[0]->expand_maybe_list_expr($_[2], -ident));
}
sub _expand_insert_clause_fields {
return +{ -row => [
- $_[0]->_expand_maybe_list_expr($_[2], -ident)
+ $_[0]->expand_maybe_list_expr($_[2], -ident)
] } if ref($_[2]) eq 'ARRAY';
return $_[2]; # should maybe still expand somewhat?
}
}
sub _expand_insert_clause_returning {
- +(returning => $_[0]->_expand_maybe_list_expr($_[2], -ident));
+ +(returning => $_[0]->expand_maybe_list_expr($_[2], -ident));
}
sub _expand_insert_values {
my $f = $options->{returning};
my ($sql, @bind) = @{ $self->render_aqt(
- $self->_expand_maybe_list_expr($f, -ident)
+ $self->expand_maybe_list_expr($f, -ident)
) };
return ($self->_sqlcase(' returning ').$sql, @bind);
}
sub _expand_update_set_values {
my ($self, undef, $data) = @_;
- $self->_expand_maybe_list_expr( [
+ $self->expand_maybe_list_expr( [
map {
my ($k, $set) = @$_;
$set = { -bind => $_ } unless defined $set;
sub _expand_update_clause_target {
my ($self, undef, $target) = @_;
- +(target => $self->_expand_maybe_list_expr($target, -ident));
+ +(target => $self->expand_maybe_list_expr($target, -ident));
}
sub _expand_update_clause_set {
}
sub _expand_update_clause_returning {
- +(returning => $_[0]->_expand_maybe_list_expr($_[2], -ident));
+ +(returning => $_[0]->expand_maybe_list_expr($_[2], -ident));
}
# So that subclasses can override UPDATE ... RETURNING separately from
sub _expand_select_clause_select {
my ($self, undef, $select) = @_;
- +(select => $self->_expand_maybe_list_expr($select, -ident));
+ +(select => $self->expand_maybe_list_expr($select, -ident));
}
sub _expand_select_clause_from {
my ($self, undef, $from) = @_;
- +(from => $self->_expand_maybe_list_expr($from, -ident));
+ +(from => $self->expand_maybe_list_expr($from, -ident));
}
sub _expand_select_clause_where {
my ($self, $fields) = @_;
return $fields unless ref($fields);
return @{ $self->render_aqt(
- $self->_expand_maybe_list_expr($fields, '-ident')
+ $self->expand_maybe_list_expr($fields, '-ident')
) };
}
sub _delete_returning { shift->_returning(@_) }
sub _expand_delete_clause_target {
- +(target => $_[0]->_expand_maybe_list_expr($_[2], -ident));
+ +(target => $_[0]->expand_maybe_list_expr($_[2], -ident));
}
sub _expand_delete_clause_where { +(where => $_[0]->expand_expr($_[2])); }
sub _expand_delete_clause_returning {
- +(returning => $_[0]->_expand_maybe_list_expr($_[2], -ident));
+ +(returning => $_[0]->expand_maybe_list_expr($_[2], -ident));
}
sub _render_delete_clause_target {
return unless defined($arg) and not (ref($arg) eq 'ARRAY' and !@$arg);
- return $self->_expand_maybe_list_expr($arg)
+ return $self->expand_maybe_list_expr($arg)
if ref($arg) eq 'HASH' and ($arg->{-op}||[''])->[0] eq ',';
my $expander = sub {
my $self = shift;
my $from = shift;
$self->render_aqt(
- $self->_expand_maybe_list_expr($from, -ident)
+ $self->expand_maybe_list_expr($from, -ident)
)->[0];
}
# UTILITY FUNCTIONS
#======================================================================
-sub _expand_maybe_list_expr {
+sub expand_maybe_list_expr {
my ($self, $expr, $default) = @_;
return { -op => [
',', map $self->expand_expr($_, $default),