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 and its functions.
- FUNCTION DUMP: Serializes every function library into a payload that FUNCTION RESTORE loads, on this server or another.
- FUNCTION FLUSH: Deletes every library.
- FUNCTION HELP: Lists the FUNCTION subcommands and what each does.
- FUNCTION KILL: Stops the function running, if it has not written.
- 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.