From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (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 05BE943D678 for ; Wed, 16 Oct 2019 16:47:05 +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> From: Kirill Shcherbatov Message-ID: <2d8aa615-79d7-8c04-13f3-93120f2015be@tarantool.org> Date: Wed, 16 Oct 2019 16:47:04 +0300 MIME-Version: 1.0 In-Reply-To: <20191016133106.GD12432@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: tarantool-patches@freelists.org, Nikita Pettik Cc: tarantool-patches@dev.tarantool.org > 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.