Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: Serge Petrenko <sergepetrenko@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: Re: [PATCH] lua: add type of operation to space trigger parameters
Date: Mon, 8 Apr 2019 13:17:23 +0300	[thread overview]
Message-ID: <20190408101723.wcqvnspjz7woqa2f@esperanza> (raw)
In-Reply-To: <20190404174945.30361-1-sergepetrenko@tarantool.org>

On Thu, Apr 04, 2019 at 08:49:45PM +0300, Serge Petrenko wrote:
> 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.
> ---
> https://github.com/tarantool/tarantool/issues/4099
> https://github.com/tarantool/tarantool/tree/sp/gh-4099-before-replace-op-type
> 
>  src/box/lua/space.cc             |  6 ++-
>  src/box/space.c                  | 10 +++++
>  test/box/before_replace.result   | 64 ++++++++++++++++++++++++++++++--
>  test/box/before_replace.test.lua | 27 +++++++++++++-
>  test/box/on_replace.result       | 54 +++++++++++++++++++++++++++
>  test/box/on_replace.test.lua     | 19 ++++++++++
>  6 files changed, 174 insertions(+), 6 deletions(-)

Pushed to master, 2.1, 1.10.

      reply	other threads:[~2019-04-08 10:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-04 17:49 Serge Petrenko
2019-04-08 10:17 ` Vladimir Davydov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190408101723.wcqvnspjz7woqa2f@esperanza \
    --to=vdavydov.dev@gmail.com \
    --cc=sergepetrenko@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [PATCH] lua: add type of operation to space trigger parameters' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox