[Dbix-class] Restricting Result Sets
Zbigniew Lukasiak
zzbbyy at gmail.com
Sat Nov 15 10:42:53 GMT 2008
On Sat, Nov 15, 2008 at 11:25 AM, Howe, Tom (IT)
<Tom.Howe at morganstanley.com> wrote:
> I've wanting something similar and ended up hacking dbix:class and added a subselect() method.
>
> Below is my previous post highlighting what I did
> ----------------------------------------------------
>
> I'll give you a summary of what ive been doing and how I've tackled it.
>
> Essentially Ive been creating a reporting framework to allow users to create reports on various datasets held in sqlite databases.
> The idea is that users can create reports on the raw data or based on existing reports.
This is a very impressive goal! I have just one question:
>
snip
snip
> # apply search /paging
> # build whereclaus from cgi params
> my $whereClause = map { ... } $self->cgi->params;
> $rs = $rs->subselect({ $whereClaus }.. { paging..} ); # search on resultset
How this subselect is different from a normal search call? I don't
want to elaborate the obvious - but you can call search on any
resultset - also one that is the output of another search - and it
combines the where clauses in effect doing search on a search. So
what is the difference here?
--
Zbigniew Lukasiak
http://brudnopis.blogspot.com/
http://perlalchemy.blogspot.com/
More information about the DBIx-Class
mailing list