extra_opt_try_member.sql 635 B

12345678910111213141516171819202122
  1. /* postgres can not */
  2. /* syntax version 1 */
  3. /* yt can not */
  4. $s = <|a:1, b:2u/1u, c:Just(Just(1))|>;
  5. $js = Just($s);
  6. $es = Nothing(Struct<a:Int32, b:Uint32?, c:Int32??>?);
  7. -- TypeOf TryMember is type of third argument
  8. -- field type should either match third type exactly, or (if the third type is optional)
  9. -- Optional(field) should be equal to third type
  10. select
  11. TryMember($s, "b", Just(Just(99u))),
  12. TryMember($s, "c", Just(Just(Just(2)))),
  13. TryMember($js, "b", Just(Just(999u))),
  14. TryMember($js, "c", Just(Just(Just(999)))),
  15. TryMember($es, "b", Just(Just(999u))),
  16. TryMember($es, "c", Just(Just(Just(999)))),
  17. ;