[Dbix-class] resultset search question

Ian Docherty dbix-class at iandocherty.com
Tue Oct 9 15:13:32 GMT 2012


On 9 October 2012 15:57, Rajeev Prasad <rp.neuli at yahoo.com> wrote:
> Hello, I guess a very basic question.
>
> In the following example: from
> http://search.cpan.org/~mstrout/DBIx-Class-0.08202/lib/DBIx/Class/ResultSet.pm
>
>
>   my @cds    = $cd_rs->search({ year => 2001 }); # "... WHERE year = 2001"
>   my $new_rs = $cd_rs->search({ year => 2005 });
>
> are we to understand that, table is 'indexed' or at least has a unique
> constraint on the column year? or can I do a search on non-index,
> non-constrained, just a normal column?
>
No, indexing is not necessary and there is no constraint on the column year.

The first example returns all rows that match year '2001' and puts the
row objects into @cds.

The second example returns a result set which represents a query for
all rows that match the year '2005'.

> thank you.
> Rajeev
>



More information about the DBIx-Class mailing list