SCRIPT DEBUG

Since 1.1.0Scripting

Syntax

SCRIPT DEBUG YES | SYNC | NO

Accepted for compatibility with Redis, and replies OK, but does nothing: KiviDB has no Lua debugger. In Redis, SCRIPT DEBUG YES or SYNC makes the next EVAL on the connection run step by step under the debugger in redis-cli --ldb. In KiviDB, the next script runs as usual, to its end, and returns its result.

It takes exactly one argument: YES, SYNC or NO. Any other word is refused with ERR Use SCRIPT DEBUG YES/SYNC/NO, as in Redis, since 1.2.1; 1.2.0 accepted it. With no argument, or more than one, it is an error.

To find what a script does, return the values you want to see, or write them to the server's log with redis.log; see Scripting.

SCRIPT DEBUG is in the lua and full builds only. The default build answers it, like every SCRIPT subcommand, with ERR this build of KiviDB has no Lua: EVAL, SCRIPT, FUNCTION and FCALL need the lua or full variant (Docker image kividb/kividb:v1.2.2-lua, or a kividb-lua release file).

Reply

OK.

Examples

> SCRIPT DEBUG YES
OK
> EVAL "return 5" 0
(integer) 5
> SCRIPT DEBUG MAYBE
(error) ERR Use SCRIPT DEBUG YES/SYNC/NO
> SCRIPT DEBUG
(error) ERR wrong number of arguments for 'script|debug' command