const.go 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. // Copyright 2019 Yunion
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package sqlchemy
  15. const (
  16. // SQL_OP_AND represents AND operator
  17. SQL_OP_AND = "AND"
  18. // SQL_OP_OR represents OR operator
  19. SQL_OP_OR = "OR"
  20. // SQL_OP_NOT represents NOT operator
  21. SQL_OP_NOT = "NOT"
  22. // SQL_OP_LIKE represents LIKE operator
  23. SQL_OP_LIKE = "LIKE"
  24. // SQL_OP_REGEXP represents REGEXP operator
  25. SQL_OP_REGEXP = "REGEXP"
  26. // SQL_OP_IN represents IN operator
  27. SQL_OP_IN = "IN"
  28. // SQL_OP_NOTIN represents NOT IN operator
  29. SQL_OP_NOTIN = "NOT IN"
  30. // SQL_OP_EQUAL represents EQUAL operator
  31. SQL_OP_EQUAL = "="
  32. // SQL_OP_LT represents < operator
  33. SQL_OP_LT = "<"
  34. // SQL_OP_LE represents <= operator
  35. SQL_OP_LE = "<="
  36. // SQL_OP_GT represents > operator
  37. SQL_OP_GT = ">"
  38. // SQL_OP_GE represents >= operator
  39. SQL_OP_GE = ">="
  40. // SQL_OP_BETWEEN represents BETWEEN operator
  41. SQL_OP_BETWEEN = "BETWEEN"
  42. // SQL_OP_NOTEQUAL represents NOT EQUAL operator
  43. SQL_OP_NOTEQUAL = "<>"
  44. )
  45. const (
  46. // TAG_IGNORE is a field tag that indicates the field is ignored, not represents a table column
  47. TAG_IGNORE = "ignore"
  48. // TAG_NAME is a field tag that indicates the column name of this field, obsolete, use TAG_SQL_NAME instead!
  49. TAG_NAME = "name"
  50. // TAG_SQL_NAME is a field tag that indicates the column name of this field, superceeds TAG_NAME!
  51. TAG_SQL_NAME = "sql_name"
  52. // TAG_WIDTH is a field tag that indicates the width of the column, like VARCHAR(15)
  53. // Supported by: mysql
  54. TAG_WIDTH = "width"
  55. // TAG_TEXT_LENGTH is a field tag that indicates the length of a text column
  56. // Supported by: mysql
  57. TAG_TEXT_LENGTH = "length"
  58. // TAG_CHARSET is a field tag that indicates the charset of a text column
  59. // Supported by: mysql
  60. TAG_CHARSET = "charset"
  61. // TAG_PRECISION is a field tag that indicates the precision of a float column
  62. TAG_PRECISION = "precision"
  63. // TAG_DEFAULT is a field tag that indicates the default value of a column
  64. TAG_DEFAULT = "default"
  65. // TAG_UNIQUE is a field tag that indicates the column value is unique
  66. TAG_UNIQUE = "unique"
  67. // TAG_INDEX is a field tag that indicates the column is a indexable column
  68. TAG_INDEX = "index"
  69. // TAG_PRIMARY is a field tag that indicates the column is part of primary key
  70. TAG_PRIMARY = "primary"
  71. // TAG_NULLABLE is a field tag that indicates the column is nullable
  72. TAG_NULLABLE = "nullable"
  73. // TAG_AUTOINCREMENT is a field tag that indicates the integer column is auto_increment, the column should must be primary
  74. TAG_AUTOINCREMENT = "auto_increment"
  75. // TAG_AUTOVERSION is a field tag that indicates the integer column is used to records the update version of a record
  76. TAG_AUTOVERSION = "auto_version"
  77. // TAG_UPDATE_TIMESTAMP is a field tag that indicates the datetime column is the updated_at timestamp
  78. TAG_UPDATE_TIMESTAMP = "updated_at"
  79. // TAG_CREATE_TIMESTAMP is a field tag that indicates the datetime column is the created_at timestamp
  80. TAG_CREATE_TIMESTAMP = "created_at"
  81. // TAG_ALLOW_ZERO is a field tag that indicates whether the column allow zero value
  82. TAG_ALLOW_ZERO = "allow_zero"
  83. // TAG_OLD_NAME is a field indicate the colume was renamed from an old name,
  84. // sync table will do renaming of coolumn instead of creating a new column
  85. TAG_OLD_NAME = "old_name"
  86. )