Class::DBI and stalinesque hiding of THE TRUTH

Stig Brautaset stig at brautaset.org
Fri Jun 23 10:36:35 BST 2006


On 23 Jun 2006, at 10:10, Simon Wistow wrote:
> Is there a clever way I can do this using cunning trickery? Possibly
> views or something. My DB skills are, at present, as weak as a  
> kitten on
> Ludes who's also in traction and wasn't particularly strong in the  
> first
> place and used to get sand kicked in its face by other, larger kittens
> when down at the kitten beach.
>
> I eagerly await the fruits of your exceptional cleverity.

How could I resist such flattery?

We have something like this, where 'user_view' is a view of the  
'user_table' which only has active users:

package RawUser;
use base 'Class::DBI';
__PACKAGE__->table('user_table');
1;


package User;
use base 'RawUser';
__PACKAGE__->table('user_view');
1;


I don't know if MySQL allows this though; we're using Pg.

Stig


More information about the london.pm mailing list