box.schema.func.create()
-
box.schema.func.
create
(func-name[, {options}]) Create a function tuple. This does not create the function itself – that is done with Lua – but if it is necessary to grant privileges for a function, box.schema.func.create must be done first. For explanation of how Tarantool maintains function data, see reference on _func space.
The possible options are:
if_not_exists
=true|false
(default =false
) - boolean;true
means there should be no error if the_func
tuple already exists.setuid
=true|false
(default = false) - withtrue
to make Tarantool treat the function’s caller as the function’s creator, with full privileges. Remember that SETUID works only over binary ports. SETUID doesn’t work if you invoke a function via an admin console or inside a Lua script.language
= ‘LUA’|’C’ (default = ‘LUA’).
Parameters: - func-name (string) – name of function, which should conform to the rules for object names
- options (table) –
if_not_exists
,setuid
,language
.
Return: nil
Example:
box.schema.func.create('calculate') box.schema.func.create('calculate', {if_not_exists = false}) box.schema.func.create('calculate', {setuid = false}) box.schema.func.create('calculate', {language = 'LUA'})