ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / Big Data / Managing REDIS databases
  • Properties specific to redisResponse variables
  • WLanguage functions that use the redisResponse type
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
redisResponse (Type of variable)
In french: redisRéponse
The redisResponse type makes it possible to define all the advanced characteristics of a response received by RedisExecuteCommand or RedisPipelineGet. The characteristics of this response can be known using different WLanguage properties.
Remark: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Example
INTERNAL PROCEDURE DisplayResult (r is redisResponse, sIdent="")
	SWITCH r.Type
		CASE redisTypeInt
			Trace(sIdent + "integer: " + r.Integer)
		CASE redisTypeError
			Trace(sIdent + "error: " + r.String)
		CASE redisTypeStatus
			Trace(sIdent + "status: " + r.String)
		CASE redisTypeNil
			Trace(sIdent + "Nil")
		CASE redisTypeArray
			Trace(sIdent + "array: ")
			FOR EACH r2 OF r.Array
				ShowResponse(r2, sIdent + TAB)
			END
		CASE redisTypeBuffer
			Trace(sIdent + "buffer in string: " + r.String)
			Trace(sIdent + "buffer in hexa: " + BufferToHexa(r.Buffer))
	END
END

r1 is redisResponse = RedisExecuteCommand(gRedis, "GET keyString")
DisplayResult(r1)
Remarks

Properties specific to redisResponse variables

The following properties can be used to manipulate a Redis response:
Property nameType usedEffect
ArrayArray of redisResponseIf the Type property matches the redisTypeArray constant, this property contains an array of redisResponse variables.
BufferBufferBinary value if the Type property matches the redisTypeBuffer constant.
This property is read-only.
IntegerIntegerInteger value if the Type property matches the redisTypeInt constant.
This property is read-only.
StringCharacter string
  • If the Type property matches the redisTypeStatus constant, this property contains the string corresponding to the returned state.
  • If the Type property matches the redisTypeError constant, this property contains the error message.
  • If the Type property matches the redisTypeBuffer constant, this property contains the buffer converted to a string using UTF-8 encoding.
This property is read-only.
TypeIntegerType of the result. This type can correspond to one of the following constants:
  • redisTypeBuffer: The result is a buffer.
  • redisTypeInt: The result is an integer.
  • redisTypeError: The result is an error.
  • redisTypeNil: The result has no value.
  • redisTypeStatus: The result is a status.
  • redisTypeArray: The result is an array.
This property is read-only.

WLanguage functions that use the redisResponse type

RedisExecuteCommandExecutes a command on a Redis server and retrieves the result.
RedisPipelineGetRetrieves the result of the execution of a Redis command that was added by RedisPipelineAdd.
Minimum version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 04/15/2024

Send a report | Local help