Tarantool development patches archive
 help / color / mirror / Atom feed
From: "n.pettik" <korablev@tarantool.org>
To: tarantool-patches@freelists.org
Cc: Kirill Shcherbatov <kshcherbatov@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH v3 3/3] box: user-friendly interface to manage ck constraints
Date: Thu, 25 Apr 2019 23:38:52 +0300	[thread overview]
Message-ID: <4D153269-CCBF-414E-A21A-02EA11979838@tarantool.org> (raw)
In-Reply-To: <0511eb70cd35f5a3b8fc527e5e08814f3188eb15.1555420166.git.kshcherbatov@tarantool.org>



> On 16 Apr 2019, at 16:51, Kirill Shcherbatov <kshcherbatov@tarantool.org> wrote:
> 
> @TarantoolBot document
> Title: check constraint for LUA space
> 
> The check constraint is a type of integrity constraint which
> specifies a requirement that must be met by tuple before it
> is inserted into space. The constraint result must be predictable.

Expression in check constraint must be <boolean value expression>
I.e. return boolean result.

> Now it is possible to create ck constraints only for empty space
> having format. Constraint expression is a string that defines
> relations between top-level tuple fields.
> Take into account that all names are converted to an uppercase
> before resolve(like SQL does), use \" sign for names of fields
> that were created not with SQL.

Describe please new order of execution: SQL triggers,
NoSQL triggers, check constraints and fk contraints.
And order between checks themselves.

Original check implementation executed check constraints
before NoSQL triggers.

> To create a new CK constraint for a space, use
> s = box.schema.create_space('person')
> _ = s:create_index('pk', {parts = {1, 'string'}})
> s:format({{name='name', type='string'}, {name='age', type='integer'},
> {name='experience', type='integer'}})
> s:ck_constraint({'physics', '\"age\" > 14 and \"experience\" <
> \"age\"’})

Why not s:create_ck_constraint() OR s:create_check().
Let's discuss names and methods in our server chat.

So, now I won’t review code in patch since it may significantly change.

  reply	other threads:[~2019-04-25 20:38 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-16 13:51 [tarantool-patches] [PATCH v3 0/3] box: run checks on insertions in LUA spaces Kirill Shcherbatov
2019-04-16 13:51 ` [tarantool-patches] [PATCH v3 1/3] schema: add new system space for CHECK constraints Kirill Shcherbatov
2019-04-25 20:38   ` [tarantool-patches] " n.pettik
2019-05-07  9:53     ` Kirill Shcherbatov
2019-05-12 13:45       ` n.pettik
2019-05-12 15:52         ` Kirill Shcherbatov
2019-05-12 23:04           ` n.pettik
2019-05-13  7:11             ` Kirill Shcherbatov
2019-05-13 12:29               ` n.pettik
2019-05-13 13:13                 ` Vladislav Shpilevoy
2019-04-16 13:51 ` [tarantool-patches] [PATCH v3 2/3] box: run check constraint tests on space alter Kirill Shcherbatov
2019-04-25 20:38   ` [tarantool-patches] " n.pettik
2019-05-07  9:53     ` Kirill Shcherbatov
2019-05-07 16:39       ` Konstantin Osipov
2019-05-07 17:47         ` [tarantool-patches] " Kirill Shcherbatov
2019-05-07 20:28           ` Konstantin Osipov
2019-05-11 12:15           ` n.pettik
2019-05-12 21:12             ` Konstantin Osipov
2019-05-13  7:09               ` Kirill Shcherbatov
2019-05-13  7:49                 ` Konstantin Osipov
2019-05-14 16:49       ` n.pettik
2019-04-16 13:51 ` [tarantool-patches] [PATCH v3 3/3] box: user-friendly interface to manage ck constraints Kirill Shcherbatov
2019-04-25 20:38   ` n.pettik [this message]
2019-05-07  9:53     ` [tarantool-patches] " Kirill Shcherbatov
2019-05-14 15:02 [tarantool-patches] [PATCH v3 0/3] box: run checks on insertions in LUA spaces Kirill Shcherbatov
2019-05-14 15:02 ` [tarantool-patches] [PATCH v3 3/3] box: user-friendly interface to manage ck constraints Kirill Shcherbatov
2019-05-14 20:09   ` [tarantool-patches] " Konstantin Osipov

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=4D153269-CCBF-414E-A21A-02EA11979838@tarantool.org \
    --to=korablev@tarantool.org \
    --cc=kshcherbatov@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH v3 3/3] box: user-friendly interface to manage ck constraints' \
    /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