Looking again at my schema ... I got suspicious and tried putting in complete gibberish in the connection strings, and it still works the same (the command that I got working before still works). So I need to figure out how to verify whether or not it's actually connecting to the database. I'm pretty confused at this point, between dbix and dbic and model and schema and which one I'm using when ... Can anyone point me towards some resources?

Thanks for your patience.

Sarah

On 6/16/06, Sarah Berry <[EMAIL PROTECTED]> wrote:
Matt,

Thanks for the suggestions. But

my $schema = $c->model("SLogDB")->schema;

gives me

Caught exception in vieSEB::Controller::dbixdemo->default "Can't
locate object method "schema" via package "vieSEB::Model::SensorLogDB"

As far as the classes, "tblsmaps" is the name of a table in the
database that contains information on the location of sensors. I'm
trying to search this table, which was set up by the schema loader if
I did that part right (which is far from certain).

Sarah


On 6/16/06, Matt S Trout <[EMAIL PROTECTED]> wrote:
> Sarah Berry wrote:
> > As far as documentation, I've been working from the introduction to the
> > DBIx class at
> > http://www.annocpan.org/~MSTROUT/DBIx-Class-0.06999_02/lib/DBIx/Class/Manual/Intro.pod
> > <http://www.annocpan.org/~MSTROUT/DBIx-Class-0.06999_02/lib/DBIx/Class/Manual/Intro.pod>
> > , as well as referencing a great thread from the list archives
> > (http://www.gossamer-threads.com/lists/catalyst/users/7463?search_string=schema%20loader
> > < http://www.gossamer-threads.com/lists/catalyst/users/7463?search_string=schema%20loader>)
> > where there's a detailed example of what files go in what Catalyst
> > folders (Model vs. Schema, etc).
> >
> > I put the following command on my page (dbixdemo.pm
> > <http://dbixdemo.pm >), and it rendered fine in the browser:
> >               my $schema = $c->model("SLogDB");
>
> my $schema = $c->model("SLogDB")->schema;
>
> > When I tried to follow it up with
> >               my $attempt = $schema->resultset('tblsmaps')->find(14);
> > I got the error
> >       Caught exception in vieSEB::Controller::dbixdemo->default "Can't
> > locate object method "resultset" via package "vieSEB::Model::SLogDB"
>
>
> why not just do
>
> my $map = $c->model("SLogDB::tblsmaps")->find(14);
>
> ?
>
> Also, "tblsmaps" is an awful name for a class. If it's a map class, call it "Map".
>
> > Maybe I have the wrong plugin installed or something. Jess, in your
> > example, what should Foo be? A table in the database? A query you set up
> > somewhere else?
> >
> > Thanks again,
> >
> > Sarah
> >
> >
> >
> > On 6/16/06, *Jess Robinson* <[EMAIL PROTECTED]
> > <mailto:[EMAIL PROTECTED]>> wrote:
> >
> >
> >
> >     On Thu, 15 Jun 2006, Kevin Old wrote:
> >
> >      > On 6/15/06, Sarah Berry < [EMAIL PROTECTED]
> >     <mailto:[EMAIL PROTECTED] >> wrote:
> >      >> I'm trying to learn how to use the database plugins,
> >     specifically DBIx. I
> >      >> set up my schemas to load from an existing database (hopefully),
> >     and now I
> >      >> want to test it out to see if I did that right. So I put the
> >     following lines
> >      >> into a page called dbixdemo.pm <http://dbixdemo.pm>, in the
> >     "default" function:
> >      >>
> >      >>         my $schema = VieSEB::Schema::SLogDB->new();
> >      >>         my $crazy_attempt =
> >      >> $schema->resultset('SLogDB')->find(14);
> >      >
> >      > Hi Sarah,
> >      >
> >      > Make your calls in Controllers like this:
> >      >
> >      > $c->model("VieSEB::Schema::SLogDB")->new();
> >      > $c->model("VieSEB::Schema::SLogDB")->search();
> >      > $c->model("VieSEB::Schema::SLogDB")->find();
> >      >
> >
> >     Or, more sanely:
> >
> >     my $schema = $c->model("SLogDB");
> >     my $attempt = $schema->resultset('Foo')->find(14);
> >
> >     or even:
> >
> >     my $attempt = $c->model('SLogDB::Foo')->find(14);
> >
> >     You shouldnt need to call ->new, as Catalyst does that for you, and
> >     stores
> >     the result, which you can retrieve using $c->model.
> >
> >     Are there not examples in the Catalyst::Model::DBIC::Schema pod?
> >
> >     Jess
> >
> >
> >     _______________________________________________
> >     List: [email protected] <mailto: [email protected]>
> >     Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> >     Searchable archive:
> >     http://www.mail-archive.com/[email protected]/
> >     Dev site: http://dev.catalyst.perl.org/
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > List: [email protected]
> > Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> > Searchable archive: http://www.mail-archive.com/[email protected]/
> > Dev site: http://dev.catalyst.perl.org/
>
>
> --
>       Matt S Trout       Offering custom development, consultancy and support
>    Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
> Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information
>
> + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +
>
> _______________________________________________
> List: [email protected]
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/[email protected]/
> Dev site: http://dev.catalyst.perl.org/
>

_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to