[tarantool-patches] [PATCH v1 3/3] box: extend box.schema.func with persistent folder

Konstantin Osipov kostja at tarantool.org
Tue May 14 21:24:53 MSK 2019


* Kirill Shcherbatov <kshcherbatov at tarantool.org> [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



More information about the Tarantool-patches mailing list