On Mon, May 16, 2011 at 10:31 PM, Octavian Rasnita <[email protected]>wrote:
> *From:* Bill Moseley <[email protected]> > > > > I have two databases that are very similar. For example, the "person" > table in one db has an "email" column and the other does not have that > column, otherwise the tables are the same. > > My application uses the schema with the table that has the "email" column, > so there's places in the application that call $person->get_column( 'email' > ), and also $person_rs->create( { name => $name, email => $email } ); > > Now, I want to use the second schema with the same application, but as > mentioned above does not have an "email" column on the person table. it's > not important that the column does not exist. > > My question is what can I do to make get_column and create (and other > methods that assume there is an "email" column) work without this column > defined in the result class. Is there any way to have define a column that > is never used when constructing database queries? > > > > Hi, > > Use in the Result class: > > __PACKAGE__->mk_group_accessors( simple => 'email' ); > > No. Although that makes an accessor (just as my "sub email {}" example would provide) it doesn't register a column so ->get_column and ->create will still fail. -- Bill Moseley [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]
