[Dbix-class] problem with query using a column that doesn't exist

Matt S Trout dbix-class at trout.me.uk
Wed Jul 12 00:02:30 CEST 2006


On 11 Jul 2006, at 22:55, Guillermo Roditi wrote:

> Hi, I am trying to execute the following query:
>
> $user->groups->search_related('items', { contact_id => $contact- 
> >id })->delete;
>
> which is generating this SQL:
> DELETE FROM `djd_group_items` WHERE ( ( ( `contact_id` = ? ) AND (
> `user_id` = ? ) ) )
>
> which makes no sense because user_id doesnt exist on that table....
>
> my table definitions are short and attached below.  can anyone help? i
> am deeply confused about this one. im running of -current right now
> but it was failing with _05 as well.

Won't be supported until subselects land. Reformulate your query to  
not require joins.

-- 
Matt S Trout, Technical Director, Shadowcat Systems Ltd.
Offering custom development, consultancy and support contracts for  
Catalyst,
DBIx::Class and BAST. Contact mst (at) shadowcatsystems.co.uk for  
details.
+ Help us build a better perl ORM: http://dbix- 
class.shadowcatsystems.co.uk/ +





More information about the Dbix-class mailing list