[Dbix-class] What namespace is best for a ResultSet Class with Custom methods

Gurunandan Bhat gbhat at pobox.com
Mon Nov 1 16:51:29 GMT 2010


I am new to DBIx::Class require help understanding a few basic issues. I
have defined an  App::Schema::Result::A class where the corresponding table,
primary keys and columns are described in the usual way.

I want to add custom methods to the class as a whole so I defined a
ResultSet class: App::Schema::ResultSet::A so that both ResultSet/A and
Result/A are under the Schema folder. However I recently came across this
Tutorial<http://search.cpan.org/%7Ejrobinson/DBIx-Class-Tutorial-0.0001/lib=
/DBIx/Class/Tutorial/Part3.pod#Adding_ResultSet_methods>that
advises:

 ## Set the new resultset class, in Breadcrumbs::Schema::Path:
>   __PACKAGE__->resultset_class('Breadcrumbs::ResultSet::Path');
>
>
> Make sure you don't create the new ResultSet class in the
> namespace/directory underneath the existing Schema. This will cause
> "load_classes" in DBIx::Class::Schema to attempt to load it as if it were=
 a
> Result class. The result will not be good.
>

 I had followed neither of the two recommendations - I did  not call
result_class on my subclass and added the new subclass directly undeneath
the Schema namespace. Yet everything magically seems to work!  Am I doing
something wrong that will blow up on me later?

Thank you for your attention
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20101101/ff2=
645e5/attachment.htm


More information about the DBIx-Class mailing list