From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 14 May 2019 21:24:53 +0300 From: Konstantin Osipov Subject: Re: [tarantool-patches] [PATCH v1 3/3] box: extend box.schema.func with persistent folder Message-ID: <20190514182453.GB3801@atlas> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: To: tarantool-patches@freelists.org Cc: vdavydov.dev@gmail.com, Kirill Shcherbatov List-ID: * Kirill Shcherbatov [19/05/14 16:31]: > Now all persistent Lua functions are available with > box.schema.func.persistent table. > lua_code = [[function(a, b) return a + b end]] > box.schema.func.create('sum', {lua_code = lua_code}) > box.schema.func.persistent.sum > --- > - call: 'function: 0x4014b7f8' > name: sum > id: 2 > ... Why do we need this? I would not do it unless there is a request. A function in Lua is a first class object, anyone could make it from the text stored in the system table. What's the point of making it for the user? A useful information would be, for procedures at least, the count and types of function arguments. But it is even better if we make this information available right in the system space, not in Lua. Please keep in mind two things: - Lua is just one language among others, SQL is the other. - the feature should work at the core level, e.g. system spaces, and Lua level is just sugar wrapping around the core. -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32