Pure.yqls 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. (
  2. #comment
  3. (let config (DataSource 'config))
  4. (let vt1 (VariantType (TupleType (DataType 'Int32) (DataType 'String))))
  5. (let vt2 (VariantType (StructType '('x (DataType 'Int32)) '('y (DataType 'String)))))
  6. (let res_sink (DataSink 'result))
  7. (let data '(
  8. (Uint32 '1)
  9. (Int32 '-2)
  10. (Uint64 '3)
  11. (Int64 '-4)
  12. (Double '-5)
  13. (Float '-6)
  14. (Bool 'true)
  15. (Yson '@@[1u;"3"]@@)
  16. (Json '@@{"id":1}@@)
  17. (Date '11)
  18. (Datetime '12)
  19. (Timestamp '13)
  20. (Interval '-13)
  21. (Uint8 '14)
  22. (Int8 '-15)
  23. (Uint16 '16)
  24. (Int16 '-17)
  25. (TzDate '"18,Europe/Moscow")
  26. (TzDate '"19,America/Los_Angeles")
  27. (TzDatetime '"20,Etc/GMT-1")
  28. (TzDatetime '"4291747199,Europe/Moscow")
  29. (TzDatetime '"4291747198,America/Los_Angeles")
  30. (TzTimestamp '"21,Etc/GMT+1")
  31. (Cast (Datetime '"1262347200") 'String)
  32. (TzDatetime '"1262347200,Europe/Moscow")
  33. (Cast (Datetime '"1277985600") 'String)
  34. (TzDatetime '"1277985600,Europe/Moscow")
  35. (Uuid '"0123456789abcdef")
  36. (AsStruct '('k (String 'key)) '('v (Uint64 '456)))
  37. (AsList (Uint32 '2))
  38. (Just (Uint32 '3))
  39. (Nothing (OptionalType (DataType 'String)))
  40. (ToDict (AsList '((String 'dkey1) (String 'dvalue1)) '((String 'dkey2) (String 'dvalue2)))
  41. (lambda '(x) (Nth x '0)) (lambda '(x) (Nth x '1)) '('Sorted 'One)
  42. )
  43. (Void)
  44. (Variant (Int32 '7) '0 vt1)
  45. (Variant (String 'qwe) 'y vt2)
  46. ))
  47. (let world (Write! world res_sink (Key) data '('('type))))
  48. (let world (Commit! world res_sink))
  49. (return world)
  50. )