[Dbix-class] Per the design of a method

dorian taylor dorian.taylor.lists at gmail.com
Thu Jun 16 20:27:47 GMT 2011


On Thu, Jun 16, 2011 at 12:57 PM, Oleg Kostyuk <cub.uanic at gmail.com> wrote:

> HTH, but if not, then re-read manuals :)

What I want to do is write a method that retrieves a subset of an
ordered result set using absolute numbers for the start and end. I
also want the count for what would be returned if the subset wasn't
specified. For the sake of the method's interface I also want to be
able to just pass in a ResultSet object rather than passing in its
WHERE clause and attributes and building two separate ResultSets
inside the method.

What I'm saying is that it would be awfully nice to be able to either
extract the WHERE clause from the supplied ResultSet so I can clone
it, or modify the rows/offset attributes, but there doesn't seem to be
any way in the DBIx::Class::ResultSet interface to actually do that.

And I can't think of any way of using Data::Page because it uses
multiples, unless I do something like set the offset to $x and collect
as many pages as $x*$y >= $z, but that is dumb.

Did I miss something?

-- 
Dorian Taylor
http://doriantaylor.com/



More information about the DBIx-Class mailing list