Greetings,

I'm trying to DBIx::Class in a mod_perl 2 environment (Win32).
I've made a base class:
package dir_browse::model::DB::Main; use warnings; use strict; use base qw/DBIx::Class::Schema::Loader/; __PACKAGE__->loader_options(relationships => 1, debug => 1); sub get_schema { return __PACKAGE__->connection('dbi:mysql:database=dir_browse', 'r +oot', 'sa', {AutoCommit => 1}); } 1;
Then I'm getting schema from the model class:
package dir_browse::model::dir_browse; use strict; use warnings; ... use dir_browse::model::DB::Main; sub new { bless { schema => &dir_browse::model::DB::Main::get_schema(), ... } } ... sub get_contents { my $self = shift; ... $self->{dir} = $self->{schema}->resultset('t_dir')->search({dr_pat +h => $dir}) or $self->{schema}->create('t_dir')->({dr_path => $dir}); ... }
Running this produces the following error:
DBIx::Class::Schema::resultset(): Can't find source for t_dir
prepended by the following warning:
No tables found in database, nothing to load at c:/Perl/site/lib/DBIx/ +Class/Sche ma/Loader/Base.pm line 443.
whilst there are tables:
mysql> use dir_browse; Database changed mysql> show tables; +----------------------+ | Tables_in_dir_browse | +----------------------+ | t_dir | | t_dir_type | | t_session | | t_user | +----------------------+
What am I doing wrong?

Thanx,
Artem.

In reply to Problem with DBIx::Class by artemave

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.