Hi Matt, It took me some time, but I eventually could get the relationships working. Thank you very much. Is what you told me documented anywhere? I am asking so that I can refer to it in future. I couldn't find it on CPAN.
Jagdish On Tue, Jul 22, 2008 at 3:13 AM, Matt S Trout <[EMAIL PROTECTED]>wrote: > On Sun, Jul 20, 2008 at 10:00:46PM +0530, jagdish eashwar wrote: > > Hi Matt, > > > > I wanted to use more than one database / schema in a web application > using > > Catalyst and DBIC. In this connection, I had asked a question on the > > Catalyst mailing list because I was not able to set up relationships > between > > tables in two separate Mysql schemas. You replied that it was possible if > > separate DBIC namespaces were set up, and suggested that for further > > discussion, I should ask the question on the DBIx mailing list. > > > > To recap, I am working on two small Catalyst web applications. One deals > > with the leave particulars of the employees and the other with the > hardware > > issued to them. Both these applications use some common information about > > the employees. At present, I am maintaining these 'common' tables in the > > schemas of both the applications. I would like to put the 'common' tables > in > > a third schema and make the two applications access them from there. > > Ok. > > MyBaseSchema should load classes for the common database using > ->table('common.foo') > > MyOneSchema should use base MyBaseSchema and load classes for the specific > db. > > That'll give you a single DBIC schema that covers both databases. Then rels > will work. > > A DBIx::Class::Schema subclass does -not- have to correspond to a single > database/schema on the db server end. If you need cross-rels, the classes > all need to be registered within a single DBIC schema, but there's no > reason the tables can't live in more than one mysql db or pg schema or > whatever. > > That's the important difference I've been trying to explain - make more > sense now? > > -- > Matt S Trout Need help with your Catalyst or DBIx::Class > project? > Technical Director > http://www.shadowcat.co.uk/catalyst/ > Shadowcat Systems Ltd. Want a managed development or deployment platform? > http://chainsawblues.vox.com/ > http://www.shadowcat.co.uk/servers/ > > _______________________________________________ > List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class > IRC: irc.perl.org#dbix-class > SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ > Searchable Archive: > http://www.grokbase.com/group/[EMAIL PROTECTED] >
_______________________________________________ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/[EMAIL PROTECTED]