[Dbix-class] Emulating CDBI "temp" columns

Drew Taylor taylor.andrew.j at gmail.com
Fri Jul 21 16:30:47 CEST 2006


Hi,
We just switched from CDBI to DBIC (.06999_07) for a webapp project
and I have a couple questions:

1) For one of the classes, I want the equivalent of CDBI's TEMP
columns or some other sort of bucket to place temporary data that will
never hit the database. I see that DBIx::Class uses
Class::Data::Accessor - but it appears to be class (not
object)-oriented.

2) I'm using DBIC w/ Catalyst, and thus am using C::P::DBIC::Schema
(latest version - no Loader). I'd like to have a base class common for
all my table objects (ie. a common toJSON() method), but can't figure
out how to do it in conjunction w/ the C::P::DBIC::Schema plugin.

At first I just tried having My::Schema::User inherit directly from
My::Schema::BaseClass, but that makes DBIC barf on Catalyst startup.
After poking around in the docs, it seems that
$schema->compose_namespace() will do what I want but I have no idea
how to work this within the DBIC plugin.

I'm quite happy w/ DBIC so far. The docs are much improved, and things
just (mostly) work. :-) The non-working stuff is likely because I
don't understand it enough though. I'll probably be posting later
about that once I'm back in front of $play computer again.

Thanks,
Drew
-- 
----------------------------------------------------------------
 Drew Taylor                 *  Web development & consulting
 Email: drew at drewtaylor.com  *  Site implementation & hosting
 Web  : www.drewtaylor.com   *  perl/mod_perl/DBI/mysql/postgres
 ----------------------------------------------------------------



More information about the Dbix-class mailing list