Open xoac opened 1 year ago
This would require a parser rework, but could be worthwhile. Its definitely doable in theory, since the old parser used to support this.
Another related question is if we should allow wildcard nullity declarations, like
--: MyType (*)
Where the star *
meaning that all fields are declared null.
For my perspective this looks counter-intuitive. I mean without documentation I couldn't guess that *
mean optional. Maybe *?
would be better what would be similar to regex.
Truly I would prefer ability to join types and make whole types optional. In case of LEFT JOIN you want the whole structure optional not only fields.
--: MyType (a, b)
--: LeftJoinType(d?, e)
--: JoinedType (MyType, LeftJoinType?).
But this is complicated to implement as LeftJoinType
would require at least one NOT NULL field to be able distinguish null struct from struct with all optional fields.
Typescript syntax for optional field (NULLABLE) is ? question mark
I suggest question mark, because it is most intuitive way
Hi in case of long SELECT with many LEFT JOIN (when joins are optional) definition can be longer It would be nice if such code would be correct: