[Dbix-class] Dummy DBIC columns?

Peter Edwards peter at dragonstaff.co.uk
Tue May 17 14:43:59 GMT 2011


On 17 May 2011 15:22, Bill Moseley <moseley at hank.org> wrote:

>
>> I have two databases that are very similar.  For example, the "person"
>> table in one db has an "email" column and the other does not have that
>> column, otherwise the tables are the same.
>> ...
>>
>> My question is what can I do to make get_column and create (and other
>> methods that assume there is an "email" column) work without this column
>> defined in the result class.  Is there any way to have define a column t=
hat
>> is never used when constructing database queries?
>>
>>
>>
Can you say

my $search_attr =3D {
  '+columns'  =3D> [ { 'email' =3D> \'' } ], # and so on for other missing
fields
};

then

my $rs =3D $schema->search_rs( $query, $search_attr );


Regards, Peter
http://perl.dragonstaff.co.uk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20110517/855=
0a736/attachment.htm


More information about the DBIx-Class mailing list