[Dbix-class] ON DELETE statement in Pg not avaiable in schema::loader?

Jess Robinson castaway at desert-island.me.uk
Mon Apr 7 07:15:08 BST 2008


On Sun, 6 Apr 2008, Matt S Trout wrote:

> On Mon, Mar 24, 2008 at 06:49:48PM +0100, Moritz Onken wrote:
>> Am 21.03.2008 um 17:43 schrieb Matt S Trout:
>>> On Sat, Mar 08, 2008 at 06:11:22PM +0100, Moritz Onken wrote:
>>>> Wouldn't it be great (tm) if we could add an "on_delete" and
>>>> "on_update" config
>>>> to all the relationships? Like the "cascade_delete" config option.
>>>>
>>>> If the DMBS supports that type of actions DBIC does not have to take
>>>> care of it,
>>>> otherwise it does.
>>>
>>> Seems reasonable, but how well can we abstract it to be non-db-
>>> specific?
>>>
>>> If we can't, I think just using sqlt_deploy_hook is the answer.
>>
>>
>> I'd like to push this a little bit because I think it could be really
>> helpful. For now I applied a patch to the current 0.09 trunk which
>> allow to set on_delete and on_update on a relationship. This will not
>> break backwards comp. but generates the correct ouput if you use SQLT.
>>
>> What do you think about a config option which tells DBIC to not handle
>> the trigger actions (on_delete on_update resp. cascade_delete)? If
>> this is set the DBMS is to handle those operations which will result
>> in a significant speed increase.
>
> How about 'software_cascade => 0' to set that, and then later we can default
> it to 0 if not supplied and provide a separate 'software_cascade => "delete"'
> option?
>
> Patches look good, please make sure they come with tests.
>

And documentation!

Jess



More information about the DBIx-Class mailing list