<< Click to Display Table of Contents >> Navigation: Multi-Protocol MasterOPC Server > Lua 5.1 Reference Manual > LuaSQLite3 Reference Manual > Methods for Callback Contexts |
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()
Returns the number of calls to the aggregate step function.
context:get_aggregate_data()
Returns the user-definable data field for callback funtions.
context:set_aggregate_data(udata)
Set the user-definable data field for callback funtions to udata.
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.
See context:result_number .
context:result_null()
This function sets the result of a callback function to nil. It returns nothing.
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(number)
This function sets the result of a callback function to the integer value in number. It returns nothing.
context:result_text(str)
This function sets the result of a callback function to the string in str. It returns nothing.
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(err)
This function sets the result of a callback function to the error value in err. It returns nothing.
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).