Available since 2.6.0.

SCRIPT LOAD script

Load a script into the scripts cache, without executing it. After the specified command is loaded into the script cache it will be callable using (not implemented) EvalshaComamnd | EVALSHA with the correct SHA1 digest of the script, exactly like after the first successful invocation of EVAL.

The script is guaranteed to stay in the script cache forever (unless SCRIPT FLUSH is called). NOTE: unit-redis-ness does not persist the script thru restarts

The command works in the same way even if the script was already present in the script cache.

Please refer to the (not implemented) EvalCommand | EVAL documentation for detailed information about Redis Lua scripting.

Return value

Bulk string reply This command returns the SHA1 digest of the script added into the script cache.

Hierarchy

Constructors

Properties

DEFAULT_ERROR: string = "ERR Unknown subcommand or wrong number of arguments for '%s'. Try SCRIPT HELP."
blocking?: boolean
dataType?: DataType

Used for "database" commands to enforce type checking.

logger: Logger = ...
maxParams?: number

Maximum number of parameters allowed. -1 for no maximum.

minParams?: number

Minimum number of parameters require.

name?: string
pubSubAllowed?: boolean

Used when PUB/SUB is in effect.

sign?: number

Sign is used in commands with a compliment command. The only current example is INCR/DECR. Sign is 1 for INCR and -1 for DECR

txIgnore?: boolean

Used in transactions to enqueue a command.

HELPERS: string = ...

Methods

  • Attempt to parse a lua script. Returns a sha1 and stores the script if it can Adds some helper function(s) to the top of the script

    Parameters

    • request: IRequest

      the client request

    • scriptIndex: number

    Returns null | string