Allow Query to return a 1-record Struct

Description

Currently we have the attributes `returnType="array"` and `returnType="struct" columnKey="..."` which are really cool, but a common use case is to return a single record from a query and convert it to struct.

That can be done by using `returnType="array"` and extracting the first row, but the proposal here is to be able to achieve the same by simply passing `returnType="struct"` without the `columnKey` attribute, which I think would be named better as `keyColumn` instead.

Activity

Show:
Michael Offner
May 30, 2020, 2:19 AM

what if there are more than one record, still throwing an error?

Igal Sapir
November 28, 2020, 4:34 PM

IMO yes, throw an error. The alternative is to return the first row but that seems like it can lead to bugs. IMO this feature will be mostly used when querying by ID, so only one row should be returned.

Fixed

Assignee

Igal Sapir

Reporter

Igal Sapir

Labels

Fix versions

Priority

New