I could not see anything on this subject but would like to know if there would be any appetite for this kind of feature.
I am happy to flesh out more details if they were likely to be deemed worth implementing.
The Problem
Currently, if one has:
Create Type FOO(
VALUE1 Int,
VALUE2 Int);
And one has a query:
Select F1, F2 from A_TABLE;
One can return the rows, or one can create a row object and cast it to FOO type.
This is fine for simple cases.
When the number of columns grows large and the code grows old this can become risky to maintain. Trusting that the order will always match and that someone wont accidentally move columns seems risky to me.
The Solution
Some syntax like:
SELECT CAST((F1=> value1, F2 => value2) AS FOO BY NAME)
or
SELECT FOO(F1 => VALUE1, F2=> value2);
or some other well-defined and non-conflicting syntax.