From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 5952543D678 for ; Wed, 16 Oct 2019 23:22:13 +0300 (MSK) References: <20191015213405.GB898@tarantool.org> <20191016055725.GB16587@atlas> <20191016110739.GB11847@tarantool.org> <20191016111142.GA16144@atlas> <20191016121811.GA12432@tarantool.org> <50e10b12-31a5-cfc0-d4ac-76d66512db43@tarantool.org> <20191016133106.GD12432@tarantool.org> <2d8aa615-79d7-8c04-13f3-93120f2015be@tarantool.org> From: Vladislav Shpilevoy Message-ID: Date: Wed, 16 Oct 2019 22:27:15 +0200 MIME-Version: 1.0 In-Reply-To: <2d8aa615-79d7-8c04-13f3-93120f2015be@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [tarantool-patches] Re: [PATCH v1 0/9] schema: rework _trigger space List-Id: Tarantool development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kirill Shcherbatov , tarantool-patches@freelists.org, Nikita Pettik Cc: tarantool-patches@dev.tarantool.org 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. >> >>> 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. > >> >>> 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. > >> >>> 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. >