[Dbix-class] deleting from a view

Dave Howorth dhoworth at mrc-lmb.cam.ac.uk
Thu Jul 7 14:17:33 GMT 2011


I wrote:
> That works but results in a series of SELECT followed by DELETE:
> 
>  SELECT me.sp_id, me.sp_status FROM sp me WHERE ( me.sp_id = ? ): '600011'
>  DELETE FROM species WHERE ( sp_id = ? ): '600011'

Just to be clear. The same pair of queries results from the following code:

 $sp_rs->find($id)->delete;

> The SELECTs are completely redundant. Is there any way in DBIC to delete
> a row from a table given the primary key other than retrieving a full
> object to invoke delete on?




More information about the DBIx-Class mailing list