[Tarantool-patches] [tarantool-patches] Re: [PATCH v1 0/9] schema: rework _trigger space
Kirill Shcherbatov
kshcherbatov at tarantool.org
Wed Oct 16 16:47:04 MSK 2019
> 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