A2Epoch:Custom SQL Calls

CHILD:500:SUPERKEY:ALLOWTABLES:REMOVEALLOWTABLES:
ALLOWTABLES and REMOVEALLOWTABLES can either be a string or array of strings each represents a table in format DbType.TableName to be allowed/removed from allow list having them both blank or missing will give you a result of all the currently allowed tables in format ["PASS",["Character.Table1","Object.Table2"]] an invalid string for any of the table names would make the whole method fail with ["ERROR",ERRORDESCR] otherwise, the return format is ["PASS",DUPLICATEALLOWED,REMOVEMISSING] where DUPLICATEALLOWED is an array of tables which you have now allowed, but were allowed anyway and REMOVEMISSING is an array of tables which you wanted to remove from the allow list, but they weren't there.

CHILD:FUNC:TBLNAME:COLUMNSARR:WHEREARR:LIMITS
CHILD:501:DbName.TableName:["ColumnName1","ColumnName2"]:["NOT",["ColumnNameX","<","Constant"]],"AND",["SomeOtherColumn","RLIKE","[0-9]"]]:[0,50]:

If you use function number 501 the request is synchronous (and query errors are returned immediately) otherwise, function number 502 is asynchronous, which means the data might be in WAIT state for a while

DbName in TBLNAME is either Character or Object The requested Table must be previously-enabled for custom data queries through HiveExt.ini

COLUMNSARR is an array of column names to fetch //alternatively, COLUMNSARR can be a single string called COUNT to get the row count ONLY

WHEREARR is an array, whose elements can either be:
 * 1. a single string, which denotes the boolean-link operator to apply in this case, it can be "AND", "OR", "NOT", or any number of "(" or ")"
 * 2. an array of 3 elements [COLUMN,OP,CONSTANT], all 3 elements should be strings COLUMN is the column on which comparison OP will be applied to you can append .length to COLUMN to use it's length instead of it's value OP can be "<", ">", "=", "<>", "IS NULL", "IS NOT NULL", "LIKE", "NOT LIKE", "RLIKE", "NOT RLIKE" CONSTANT is a literal value with which to perform the comparison in the LIKE/RLIKE case, it's either a LIKE formatting string, or a REGEXP formatted string

LIMITS is either an array of two numbers, [OFFSET, COUNT] or a single number COUNT this corresponds to the SQL versions of LIMIT COUNT or LIMIT OFFSET,COUNT this parameter is optional, you can omit it by just not having that :[*] at the end

The return value is either ["PASS",UNIQID] where UNIQID represents the string token that you can later use to retrieve results or ["ERROR",ERRORDESCR] where ERRORDESCR is a description of the error that happened

CHILD:503:UNIQID:
UNIQID is the string you received with a call to 501/502 the return value is either
 * ["PASS",numRows,numFields,[field1,field2]]
 * ["WAIT"]
 * ["ERROR",ERRORDESCR]
 * ["UNKID",isInvalidId]

"PASS" return code gives you information about the query, like total number of rows, number of fields, and the field names in an array "WAIT" = the asynchronous operation didn't complete yet "ERROR" = the asynchronous operation failed, error info is in ERRORDESCR if you get this result, the UNIQID will not be usable anymore (not even for status) "UNKID" = unknown UNIQID specified, or it has been cleared (by fetching ERROR status or last row) additiionally, if isInvalidId is set to true, then the UNIQID is malformed/missing and would never have worked.

CHILD:504:UNIQID:
see documentation for 503 for everything except when the return code is PASS or NOMORE:


 * ["PASS",["fieldVal1","fieldVal2",false,"fieldVal3"]] the second element of the return array is the array of field values each field value will just be a string, EXCEPT if the field IS NULL then the field value will be a boolean false


 * ["NOMORE"] indicates that the result set rows have been exhausted no actual field values are returned, just a marker to let you know that you should stop and close the request

CHILD:505:UNIQID:
closes a retrieved request or cancels a pending one
 * returns PASS if it was closed/cancelled
 * returns UNKID if the UNIQID was already closed/bad

EXAMPLES
Retrieve medical data for CharacterID:

Request object inventory by ObjectID:

Fetch one row of data: