[Dbix-class] Write only + No-read/retrieve on a column

Mark Smith smitty at gmail.com
Sat Dec 29 08:01:39 GMT 2007


> What do you think? Two classes for the table? One for admin functions
> which has the LONGBLOB in it and one for the web app (Catalyst) which
> doesn't?
>
> Is there a better trick for this kind of thing?

Typical SQL "best practice" is to use two tables ... the meta-data
table (or main table) and then another table that contains only the
data that you don't want to be loaded/cached so much (the blob).

If you do that, then you could simply create two classes, with a
has_one relationship.  If you're going to be using the blob you can
use prefetch on the initial find/search, and if not, then it doesn't
get loaded.

(Take with a grain of salt, I'm fairly new to this DBIx::Class thing,
but this is what I'd suggest...)


-- 
Mark Smith / xb95
smitty at gmail.com



More information about the DBIx-Class mailing list