On Feb 6, 2008 3:18 PM, Sam Tregar <[EMAIL PROTECTED]> wrote:
> Hey all.  I'm working on migrating a Class::DBI system to RDBO and I'm
> wondering how to implement "temp" columns.  In CDBI these are accessors that
> behave like normal column accessors but don't store data in the database.
> Weird, but sometimes useful.  Here's how they're setup in Class::DBI:
>
>   __PACKAGE__->columns(TEMP => qw/foo bar baz/);
>
> Is there a RDBO equivalent?

If you just want simple scalar object attribute accessors, they're
easy enough to make with your favorite method-maker.  Here's an
example using the Rose::Object scalar method-maker:

http://www.mail-archive.com/rose-db-object@lists.sourceforge.net/msg01608.html

If you want these "fake" columns to behave like RDBO columns in terms
of parsing values according to the (fake) column data type, that's
also possible if you call the appropriate
Rose::DB::Object::MakeMethods::* method-maker methods directly, but
it's a pain to have to look up the correct classes, methods, and args.

So far in my work, I have not come across a need for such a thing and
have gotten by using Rose::Object's simple method-maker to add non-db
object attributes.  But it'd be a good exercise in learning how RDBO's
method-maker infrastructure works for someone to automate this into a
proper column-data-type-aware "fake (or temporary, if you wish)
column" API :)

-John

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to