I'm having problems using DBIxResultSet in Catalyst, and I haven't been able to solve the issue. I'm sure it's something simple, but I'm fairly new to using both, so it's not obvious to me, and I've exhausted all the search results to no avail. I get the following error message:

"Can't locate object method "next" via package "DBIx::ResultSet"

The manual says:

"There's likely a syntax error in the table class referred to elsewhere in this error message. In particular make sure that the package declaration is correct, so for a schema MySchema you need to specify a fully qualified namespace: package MySchema::MyTable; for example."

There's no table class referred to in the message though, and all the package declarations appear to be correct.

I have a ResultSet class that is basically copied and pasted from the docs:

package AppName::Model::DBIxResultSet; use Moose; use namespace::autoclean; extends 'Catalyst::Model::DBIxResultSet'; __PACKAGE__->config( dsn => 'dbi:SQLite:data/appname.db', user => '', password => '', on_connect_do => q{PRAGMA foreign_keys = ON}, ); __PACKAGE__->meta->make_immutable; 1;

and I'm calling it in the same way as in the docs, using DBIx::Class::ResultClass::HashRefInflator though:

my $model = $c->model('DBIxResultSet'); my $rs = $model->resultset('users')->search({}, {order_by => 'num DESC +', rows => 10, result_class => 'DBIx::Class::ResultClass::HashRefInfl +ator'}); while (my $user = $rs->next) { # code }

Anything I try to do that involves calling a ResultSet method brings the same type of error message. If anyone could point me in the right direction, I'd be appreciative. I've only found a few issues such as this when searching, and none of the solutions have been relevant.


In reply to Problems using DBIxResultSet in Catalyst by LunarCowgirl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.