use Moose;
use Method::Signatures::Simple;
use Data::Perl::Stream::Array;
+use Data::Perl::Collection::Set;
use Scalar::Util qw(weaken refaddr);
has _store => (is => 'ro', required => 1, init_arg => 'store');
Data::Perl::Stream::Array->new(array => $self->_member_cache);
}
+# theoretically inefficient except that if we're being asked this then
+# either the data should have been pre-loaded or we're going to get all
+# elements anyway
+
+method count {
+ scalar $self->flatten
+}
+
+method map ($sub) {
+ Data::Perl::Collection::Set->new(
+ members => [ map $sub->($_), $self->flatten ]
+ )
+}
+
method _set_caches ($members) {
$self->_set_member_cache($members);
$self->_set_key_cache_members($members);
has "select_column_order" => (is => 'ro');
+has implicit_arguments => (is => 'ro');
+
method new_select_command ($args) {
die "$self->has_select_sql" unless $self->has_select_sql;
$self->raw_store->new_stream_command(
}
method _unwrap_args_for ($type, $args) {
+ if (my $implicit = $self->implicit_arguments) {
+ $args = { %$implicit, %$args };
+ }
[ @{$args}{@{$self->${\"${type}_argument_order"}}} ]
}