[Dbix-class] A problem with Postgres schemas
Kevin Esteb
kesteb at wsipc.org
Thu Dec 28 23:48:07 GMT 2006
Thanks John for the help. I figured out the problem with my "real" code.
The toolkit that I am using, uses the table name to reference the table.
This works fine when the table name and class name are the same. I guess
I am the first to use "schema.table" so I broke the toolkits code.
So I wrote up the problem, with examples, and sent it back to the
maintainers. I thank this list for all the help. Without it, I didn't
have a clue what was going on. So thanks again.
-----Original Message-----
From: John Napiorkowski [mailto:jjn1056 at yahoo.com]
Sent: Thursday, December 28, 2006 3:37 PM
To: dbix-class at lists.rawmode.org
Subject: Re: [Dbix-class] A problem with Postgres schemas
--- Brandon Black <blblack at gmail.com> wrote:
> On 12/28/06, Kevin Esteb <kesteb at wsipc.org> wrote:
> > I new to DBIx::Class, so please bear with me.
> >
> > I am running RHEL4 and have a postgres database
> with a schema named
> > "analog". The DBIx::Class modules are the latest
> and greatest from CPAN,
> > so is the DBD and the DBI for postgres. When I run
> the below code, I get
> > this error:
> >
> > DBIx::Class::Schema::resultset(): Can't find
> source for analog.master at
> > test9.pl line 28
> >
>
> Your table named analog.master has a
> source/resultset name of "Master"
> in your example, so you should get at the resultset via
> $schema->resultset('Master'), instead of
> $schema->resultset('analog.master');
>
> If you are going to have multiple postgres schemas used within this
> DBIx::Class::Schema, it is probably advisable to encode the schema
> name in the source name, which means changing Test::Schema::Master to
> Test::Schema::Analog::Master, and the accessing via
> $schema->resultset('Analog::Master');
Yeah, that's the way I have it setup, might solve your ongoing troubles.
Here is my structure:
myapp (directory)
Schema (directory)
(db.pm, package myapp::Schema::db)
db (directory)
membership (directory)
(members.pm, package
myapp::Schema::db::membership::members)
wikis (directory)
(pages.pm, package
myapp::Schema::db::wikis::pages)
And so on. Basically I group all my postgres schemas under the 'db'
directory. I find this just works.
I can forward a tar of my working setup to an address of your choice if
this still gives you trouble.
--john
--john
>
> -- Brandon
>
> _______________________________________________
> List:
>
http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
> Wiki: http://dbix-class.shadowcatsystems.co.uk/
> IRC: irc.perl.org#dbix-class
> SVN:
>
http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
> Searchable Archive:
>
http://www.mail-archive.com/dbix-class@lists.rawmode.org/
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive:
http://www.mail-archive.com/dbix-class@lists.rawmode.org/
More information about the Dbix-class
mailing list