Toby Corkindale wrote:
> Hey all,
> Wouldn't it be nice if the ResultSet iterators were a bit more advanced?
> 
> I would love it if the iterator built into DBIx::Class supported some
> more functional programming style methods.
> 
> ie. So that I could do:
> 
> $schema->resultset('Users')->search(
>   { first_name => 'Bob' }
> )->foreach(
>   sub { email_user($_) }
> );
> 
> Or to "map" to get the results I want in one hit:
> 
> my @uppercase_names = $schema->resultset('Users')->search(
>   { first_name => 'Bob' }
> )->map(
>   sub { uc($_->last_name . $_->firstname)  }
> );
> 
> Or do a more complex check, grep style, to filter the list:
> 
> my @y_users = $schema->resultset('Users')->search(
>   { first_name => 'Bob' }
> )->grep(
>   sub { return complex_check($_)  }
> );
> 

The implicit iterators built into DBIC resultsets were a blatant design
mistake, and therefore they will not be extended any longer (at least not
in core). You are however welcome to discuss a design for a ResultSet
component, or even contribute to the DBIx::Class::Helpers family of modules.

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]

Reply via email to