FUNCTION
Since 1.1.0Scripting
Syntax
FUNCTIONManages libraries of functions, which FCALL calls. Libraries are kept with the data, in snapshots and the AOF, so they come back when the server restarts. See its subcommands.
FUNCTION DUMP serializes every library into a payload, and FUNCTION RESTORE payload [FLUSH | APPEND | REPLACE] loads one. The format is KiviDB's own. By default, RESTORE fails if a library in the payload exists; REPLACE replaces those, FLUSH deletes every library first.
> FUNCTION DUMP
"..." (a binary payload)
> FUNCTION RESTORE "..." REPLACE
OK
Subcommands
- FUNCTION DELETE: Deletes a library of functions, and with it every function the library registered.
- FUNCTION DUMP: Returns every library of functions as one binary payload, which FUNCTION RESTORE loads, on this server or another KiviDB server.
- FUNCTION FLUSH: Deletes every library of functions, and so every function: FCALL of any of them then fails with ERR Function not found.
- FUNCTION HELP: Lists the FUNCTION subcommands, each with its arguments and a line on what it does, as the server knows them.
- FUNCTION KILL: Stops the function that is running, called with FCALL or FCALL_RO, if it has not written anything yet.
- FUNCTION LIST: Returns every library, or those whose names match LIBRARYNAME pattern, with its functions, each with its description and flags.
- FUNCTION LOAD: Loads a library of functions.
- FUNCTION RESTORE: Loads a payload from FUNCTION DUMP.
- FUNCTION STATS: Returns the function running, if any (its name, command and duration so far), and the number of libraries and functions.