lua: add type of operation to space trigger parameters
Add the type of operation which is being executed to before_replace and on_replace triggers. Closes #4099 @TarantoolBot document Title: new parameter for space before_replace and on_replace triggers Now before_replace and on_replace triggers accept an additional parameter: the type of operation that is being executed. (INSERT/REPLACE/DELETE/UPDATE/UPSERT) For example, a trigger function may now look like this: ``` function before_replace_trig(old, new, space_name, op_type) if op_type == 'INSERT' then return old else return new end end ``` And will restrict all INSERTs, but allow REPLACEs, UPSERTs, DELETEs and UPDATEs.
Showing
- src/box/lua/space.cc 5 additions, 1 deletionsrc/box/lua/space.cc
- src/box/space.c 10 additions, 0 deletionssrc/box/space.c
- test/box/before_replace.result 61 additions, 3 deletionstest/box/before_replace.result
- test/box/before_replace.test.lua 25 additions, 2 deletionstest/box/before_replace.test.lua
- test/box/on_replace.result 54 additions, 0 deletionstest/box/on_replace.result
- test/box/on_replace.test.lua 19 additions, 0 deletionstest/box/on_replace.test.lua
Loading
Please register or sign in to comment