as_dict_tuple_key.sql 831 B

123456789101112131415161718192021222324252627
  1. /* postgres can not */
  2. $d = AsDict(
  3. AsTuple(AsTuple(),"foo"),
  4. AsTuple(AsTuple(),"bar")
  5. );
  6. select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
  7. select DictLookup($d,AsTuple());
  8. select DictContains($d,AsTuple());
  9. $d = AsDict(
  10. AsTuple(AsTuple(1),"foo"),
  11. AsTuple(AsTuple(2),"bar")
  12. );
  13. select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
  14. select DictLookup($d,AsTuple(1)),DictLookup($d,AsTuple(3));
  15. select DictContains($d,AsTuple(1)),DictContains($d,AsTuple(3));
  16. $d = AsDict(
  17. AsTuple(AsTuple(1,2),"foo"),
  18. AsTuple(AsTuple(1,3),"bar")
  19. );
  20. select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
  21. select DictLookup($d,AsTuple(1,2)),DictLookup($d,AsTuple(1,4));
  22. select DictContains($d,AsTuple(1,2)),DictContains($d,AsTuple(1,4));