Methods for Callback Contexts

<< Click to Display Table of Contents >>

Navigation:  Multi-Protocol MasterOPC Server > Lua 5.1 Reference Manual > LuaSQLite3 Reference Manual >

Methods for Callback Contexts

Methods for Callback Contexts

mbul_mail context:aggregate_count

mbul_mail context:get_aggregate_data

mbul_mail context:set_aggregate_data

mbul_mail context:result

mbul_mail context:result_double

mbul_mail context:result_null

mbul_mail context:result_number

mbul_mail context:result_int

mbul_mail context:result_text

mbul_mail context:result_blob

mbul_mail context:result_error

mbul_mail context:user_data

A callback context is available as a parameter inside the callback functions db:create_aggregate and db:create_function . It can be used to get further information about the state of a query.

context:aggregate_count

context:aggregate_count()

Returns the number of calls to the aggregate step function.

context:get_aggregate_data

context:get_aggregate_data()

Returns the user-definable data field for callback funtions.

context:set_aggregate_data

context:set_aggregate_data(udata)

Set the user-definable data field for callback funtions to udata.

context:result

context:result(res)

This function sets the result of a callback function to res. The type of the result depends on the type of res and is either a number or a string or nil. All other values will raise an error message.

context:result_double

See context:result_number .

context:result_null

context:result_null()

This function sets the result of a callback function to nil. It returns nothing.

context:result_number

context:result_number(number)

context:result_double(number)

This function sets the result of a callback function to the value number. It returns nothing.

context:result_int

context:result_int(number)

This function sets the result of a callback function to the integer value in number. It returns nothing.

context:result_text

context:result_text(str)

This function sets the result of a callback function to the string in str. It returns nothing.

context:result_blob

context:result_blob(blob)

This function sets the result of a callback function to the binary string in blob. It returns nothing.

context:result_error

context:result_error(err)

This function sets the result of a callback function to the error value in err. It returns nothing.

context:user_data

context:user_data()

Returns the userdata parameter given in the call to install the callback function (see db:create_aggregate and db:create_function for details).