if (my $cache = $self->get_cache) {
my @related_cache = map
- { @{$_->related_resultset($rel)->get_cache||[]} }
+ { $_->related_resultset($rel)->get_cache || () }
@$cache
;
- $new->set_cache(\@related_cache) if @related_cache;
+ $new->set_cache([ map @$_, @related_cache ]) if @related_cache == @$cache;
}
$new;
});
}
+The current table alias can be altered with L</alias>.
+
=cut
sub current_source_alias {
select => [qw/foo baz/],
as => [qw/foo bar/]
+Like elsewhere, literal SQL or literal values can be included by using a
+scalar reference or a literal bind value, and these values will be available
+in the result with C<get_column> (see also
+L<SQL::Abstract/Literal-SQL-and-value-type-operators>):
+
+ # equivalent SQL: SELECT 1, 'a string', IF(x,1,2) ...
+ columns => [
+ {
+ foo => \1,
+ bar => \q{'a string'},
+ baz => \[ '?', 'IF(x,1,2)' ],
+ }
+ ]
+
=head2 +columns
=over 4