[Dbix-class] (no subject)

Pedro Melo melo at simplicidade.org
Fri May 16 23:56:03 BST 2008


Hi,

I'm using a database with foreign key constraints that supports  
cascade deletes. I'm also using DBIx::Class::Schema::create_ddl_dir  
to generate the SQL.

So I use the cascade_delete relation attribute to control the  
generated SQL.

My problem is that a true value there also enables the internal  
DBIx::Class cascade delete (the sub delete in DBIx::Class::  
Relationship::CascadeActions does that) and looking at that code  
there is no way to disable the behavior without compromising the SQL  
generation. And this generates queries that really don't serve any  
purpose because the DB already did it.

I was thinking about adding a flag to the storage layer that a user  
could turn on stating "yes, I have a modern database, don't do  
cascade deletes".

Would that be the proper place to do it? Any other suggestions?

Best regards,
-- 
Pedro Melo
Blog: http://www.simplicidade.org/notes/
XMPP ID: melo at simplicidade.org
Use XMPP!





More information about the DBIx-Class mailing list