tracker issue : CF-4202303

select a category, or use search below
(searches all categories and all time range)
Title:

[ANeff] ER for: QueryToArray()/query.toArray() or QueryGetRows()/query.getRows()

| View in Tracker

Status/Resolution/Reason: To Track//PRNeedInfo

Reporter/Name(from Bugbase): Aaron Neff / ()

Created: 05/06/2018

Components: Language

Versions: 2018

Failure Type: Others

Found In Build/Fixed In Build: /

Priority/Frequency: Normal /

Locale/System: /

Vote Count: 0

Issue: queryNew(columns,types,arrayOfStructs) can build a query from an arrayOfStructs (good), but no function* exists for getting an arrayOfStructs from a query.

Suggestion: queryToArray(theQuery)/theQuery.toArray(), or queryGetRows(theQuery[,startRow,endRow])/theQuery.getRows([startRow,endRow]), to return array of structs

Workarounds:

array function queryToArray(required query query) {
  return ARGUMENTS.query.reduce(function(result, row) {return result.append(row);}, []);
}
-or-
array function queryToArray(required query query) {
  return deserializeJSON(serializeJSON(ARGUMENTS.query, "struct"));
}

* - QueryGetRow()/query.getRow() exist, but only get 1 row (as struct). So, perhaps it makes sense to go w/ the more flexible and similarly-named QueryGetRows(theQuery[,startRow,endRow]) instead of the more limited QueryToArray(theQuery).

Attachments:

Comments:

Hi Adobe, I see this is "To Track / PRNeedInfo". What info do you need from me? Thanks!, -Aaron
Comment by Aaron N.
27778 | May 13, 2018 07:50:38 AM GMT