Project

General

Profile

Actions

Feature proposal #7890

closed

Improve Query action to support custom select query results output

Added by krileon over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
25 March 2020
Due date:
% Done:

100%

Estimated time:

Description

Currently the query action just returns the results of loadResult(). There's no customization beyond that. You can't specify how rows or columns are handled like a query field. Implement formatting support in addition to raw output that returns an array or object to be serialized to JSON.

Actions #1

Updated by krileon over 4 years ago

  • Status changed from Assigned to Resolved
  • % Done changed from 0 to 100

If the query contains a LIMIT of anything greater than 1 (e.g. LIMIT 5, or LIMIT 0, 5) or no LIMIT at all the result will be treated as an array. If the array result contains only 1 column the results will be comma separated. If the array result contains more than 1 column the results will be output as JSON. If the query does have a LIMIT 1 or LIMIT 0, 1 for single row output then the same parsing rules apply with single column directly being returned while multiple columns will be output as JSON. This will allow the query endpoint to work as an API endpoint due to JSON response being supported.

Actions #2

Updated by krileon over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF