[Dbix-class] Weird things you'd like to do with DBIx::Class.

Matt S Trout dbix-class at trout.me.uk
Fri Jul 29 05:07:59 CEST 2005


On Fri, Jul 29, 2005 at 02:16:19AM +0100, Matt S Trout wrote:
> __PACKAGE__->add_relationship('tagline', 'My::MovieDetails' =>
>                                 { 'foreign.movie' => 'self.id',
>                                   'foreign.field' => \'tagline' });
> 

Bugger. \"'tagline'" because the Abstract code passes it through completely
unescaped. We probably need to figure out a nice way of providing literal
values in join conditions that quotes nicely but doesn't get in the way
of simple expression of the field stuff.

Which probably means we want to start storing column types, or pulling
them out the database, or something.

And this is why the values for the keys in _columns and _primaries are all
hashrefs - so we've got plenty of space to stuff whatever information we
need in. Yes, maybe they should be objects but I don't want to tie us down
yet, and the necessary refactoring can be done via an s/// regex when we
need it.

-- 
     Matt S Trout           Website: http://www.shadowcatsystems.co.uk
  Technical Director        E-mail:  mst (at) shadowcatsystems.co.uk
Shadowcat Systems Ltd.



More information about the Dbix-class mailing list