Types.hx 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /*
  2. * Copyright (c) 2005-2011, The haXe Project Contributors
  3. * All rights reserved.
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are met:
  6. *
  7. * - Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * - Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. *
  13. * THIS SOFTWARE IS PROVIDED BY THE HAXE PROJECT CONTRIBUTORS "AS IS" AND ANY
  14. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  15. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  16. * DISCLAIMED. IN NO EVENT SHALL THE HAXE PROJECT CONTRIBUTORS BE LIABLE FOR
  17. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  18. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  19. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  20. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  21. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  22. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
  23. * DAMAGE.
  24. */
  25. package sys.db;
  26. // basic types
  27. /** int with auto increment **/
  28. typedef SId = Int
  29. /** int unsigned with auto increment **/
  30. typedef SUId = Int
  31. /** big int with auto increment **/
  32. typedef SBigId = Float
  33. typedef SInt = Int
  34. typedef SUInt = Int
  35. typedef SBigInt = Float
  36. /** single precision float **/
  37. typedef SSingle = Float
  38. /** double precision float **/
  39. typedef SFloat = Float
  40. /** use tinyint(1) to distinguish with int **/
  41. typedef SBool = Bool
  42. /** same as varchar(n) **/
  43. typedef SString<Const> = String
  44. /** date only, use SDateTime for date+time **/
  45. typedef SDate = Date
  46. /** mysql DateTime **/
  47. typedef SDateTime = Date
  48. /** mysql Timestamp **/
  49. typedef STimeStamp = Date
  50. /** TinyText (up to 255 bytes) **/
  51. typedef STinyText = String
  52. /** Text (up to 64KB) **/
  53. typedef SSmallText = String
  54. /** MediumText (up to 24MB) **/
  55. typedef SText = String
  56. /** Blob type (up to 64KB) **/
  57. typedef SSmallBinary = haxe.io.Bytes
  58. /** LongBlob type (up to 4GB) **/
  59. typedef SLongBinary = haxe.io.Bytes
  60. /** MediumBlob type (up to 24MB) **/
  61. typedef SBinary = haxe.io.Bytes
  62. /** same as binary(n) **/
  63. typedef SBytes<Const> = haxe.io.Bytes
  64. /** one byte signed [-128...127] **/
  65. typedef STinyInt = Int
  66. /** two bytes signed [-32768...32767] **/
  67. typedef SSmallInt = Int;
  68. /** three bytes signed [-8388608...8388607] **/
  69. typedef SMediumInt = Int;
  70. /** one byte [0...255] **/
  71. typedef STinyUInt = Int
  72. /** two bytes [0...65535] **/
  73. typedef SSmallUInt = Int;
  74. /** three bytes [0...16777215] **/
  75. typedef SMediumUInt = Int;
  76. // extra
  77. /** specify that this field is nullable **/
  78. typedef SNull<T> = T
  79. /** specify that the integer use custom encoding **/
  80. typedef SEncoded = Int
  81. /** haxe Serialized string **/
  82. typedef SSerialized = String
  83. /** native neko serialized bytes **/
  84. typedef SNekoSerialized = haxe.io.Bytes
  85. /** a set of bitflags of different enum values **/
  86. typedef SFlags<T:EnumValue> = haxe.EnumFlags<T>
  87. /** same as [SFlags] but will adapt the storage size to the number of flags **/
  88. typedef SSmallFlags<T:EnumValue> = SFlags<T>;