[Tarantool-patches] [tarantool-patches] Re: [PATCH v1 0/9] schema: rework _trigger space

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Wed Oct 16 23:27:15 MSK 2019


Hi!

JFY, I agree with Kirill and Kostja. Triggers are
triggers, regardless of their language. If something is
not yet supported in box triggers, it will be supported
later. We will have much more trouble with managing two
tables, than in having to validate its tuples more
rigorously. After all, tuple validation will happen just
in alter.cc and only one time. I don't see why is it such
a problem, to just validate a tuple. While having two
tables will affect the whole lifetime of a space.

On 16/10/2019 15:47, Kirill Shcherbatov wrote:
>> Strictly speaking, this relates only to NoSQL triggers.
>>
>>> <event_manipulation> STR  {"DELETE", "UPDATE", "INSERT" --
>>>                                                SQL only? - but it is possible to support it in Lua also}
>>> How is this supposed to be supported in Lua? For NoSQL triggers only "replace"
>> event is valid, which obviously is non of delete, update or insert.
> Lua has Lua triggers, right. But they have old and new tuple.
> As you know, 
> INSERT = REPLACE(old=NULL, new)
> DELETE = REPLACE(old, new=NULL)
> UPDATE = REPLACE(old, new)
> 
> So formally we may use such terminology and support corresponding
> trigger_def-based if(s) if we like it.
> 
> On the other hand some options could be banned for some engines.
> 
>>
>>> <action_timing> STR {"BEFORE", "AFTER" - both have}
>>
>> AFTER is not the same as on_replace; SQL also has INSTEAD.
> Yes, unfortunately INSTEAD OF is a different thing. And I test it in trigger_def_check
> helper.
>  
>>
>>> <code> STR (both have)
>>
>> You format missing func_id which is required for NoSQL triggers and action
>> (FOR EACH STMT/ROW) which is valid for SQL only.
> We don't have to take a reference to function object by id, it is messy.
> Let's better assemble own object using body field. 
> 


More information about the Tarantool-patches mailing list