From: "Marcello Romani" <mrom...@ottotecnica.com>> Octavian Râsnita ha scritto:
On Tue, May 26, 2009 at 01:37:40AM +0200, Daniel Carrera wrote:
>Being able to chain resultsets makes it much much easier than using
>straight SQL, and you write less code.  If you have a query you've
>constructed called $query, and lets say you now only want active
records
>you can do $query = $query->search({ active => 1 });  In this way you
>can filter many things incrementally.

But is that efficient? It looks like you are getting MySQL to return the entire data set and then making Perl filter it. That can't be efficient.

Here it is a short code example that might appear in a controller:

sub author : Local {
[snip]

I think this example is very interesting and should end up into the wiki somewhere!

I think it can be a good selling point for DBIC, but I've not seen it explained so well until now (but I admit I've not looked up the docs in a while...)

Thank you.

--
Marcello Romani

Ok, I will correct it (because I remember at least an error in it), test it and put it in a wiki.

Can anyone recommend a good place for a thing like this?

Octavian


_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to