From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp32.i.mail.ru (smtp32.i.mail.ru [94.100.177.92]) (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 7F176469719 for ; Mon, 28 Sep 2020 21:19:15 +0300 (MSK) Date: Mon, 28 Sep 2020 18:19:13 +0000 From: Nikita Pettik Message-ID: <20200928181913.GD14909@tarantool.org> References: <66362762-8791-bea3-745f-afc1e3eaa199@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <66362762-8791-bea3-745f-afc1e3eaa199@tarantool.org> Subject: Re: [Tarantool-discussions] SQL built-in functions position List-Id: Tarantool development process List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mergen Imeev Cc: tarantool-discussions@dev.tarantool.org On 27 Sep 18:18, Mergen Imeev wrote: > Hi all. I have a question that I would like to discuss. > > The question is about SQL built-in functions. At the moment these functions > are > partially described in _func and partially in src/box/sql/func.c. I received > two > completely different suggestions from my reviewers on what to do with these > functions: > 1) Move definitions completely to _func. Remove definitions from func.c. That's my proposal. It makes name collisions check simple, provides unified interface to invoke built-in and non-built-in functions, allows to grant and verify priveleges in the same way and so forth. Built-ins are already declaraed in _func, so reverting this thing would result in another one unnecessary schema change and upgrade (so I doubt that implementation would be somehow 'simpler'). Finally part of functions can turn out to be really usefull in Lua someday such as date()/time(). So to me the choice is kind of obvious.. > 2) Move definitions completely to func.c. Remove definitions from _func. > > In the first case, users will be able to see the function definitions. Also, > in > the future, we may allow these functions to be called from Lua (although not > sure if this is necessary). The main idea is 'all functions have the same > interface'. > > In the second case, the implementation is simpler, and we can more easily > implement some features, such as "virtual" functions. For users, the > definition > can only be seen in the documentation. The main idea is 'SQL built-in > functions > are part of SQL'. > > Which of these approaches do you think is more beneficial to us? >