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 29, 2020, 4:19 PM

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

Igal Sapir
7 days ago

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.

Assignee

Igal Sapir

Reporter

Igal Sapir

Labels

Priority

New
Configure