compapiasynctask.go 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. // Code generated by ent, DO NOT EDIT.
  2. package compapiasynctask
  3. import (
  4. "time"
  5. "entgo.io/ent/dialect/sql"
  6. )
  7. const (
  8. // Label holds the string label denoting the compapiasynctask type in the database.
  9. Label = "compapi_asynctask"
  10. // FieldID holds the string denoting the id field in the database.
  11. FieldID = "id"
  12. // FieldCreatedAt holds the string denoting the created_at field in the database.
  13. FieldCreatedAt = "created_at"
  14. // FieldUpdatedAt holds the string denoting the updated_at field in the database.
  15. FieldUpdatedAt = "updated_at"
  16. // FieldAuthToken holds the string denoting the auth_token field in the database.
  17. FieldAuthToken = "auth_token"
  18. // FieldEventType holds the string denoting the event_type field in the database.
  19. FieldEventType = "event_type"
  20. // FieldChatID holds the string denoting the chat_id field in the database.
  21. FieldChatID = "chat_id"
  22. // FieldResponseChatItemID holds the string denoting the response_chat_item_id field in the database.
  23. FieldResponseChatItemID = "response_chat_item_id"
  24. // FieldOrganizationID holds the string denoting the organization_id field in the database.
  25. FieldOrganizationID = "organization_id"
  26. // FieldOpenaiBase holds the string denoting the openai_base field in the database.
  27. FieldOpenaiBase = "openai_base"
  28. // FieldOpenaiKey holds the string denoting the openai_key field in the database.
  29. FieldOpenaiKey = "openai_key"
  30. // FieldRequestRaw holds the string denoting the request_raw field in the database.
  31. FieldRequestRaw = "request_raw"
  32. // FieldResponseRaw holds the string denoting the response_raw field in the database.
  33. FieldResponseRaw = "response_raw"
  34. // FieldCallbackURL holds the string denoting the callback_url field in the database.
  35. FieldCallbackURL = "callback_url"
  36. // FieldCallbackResponseRaw holds the string denoting the callback_response_raw field in the database.
  37. FieldCallbackResponseRaw = "callback_response_raw"
  38. // FieldModel holds the string denoting the model field in the database.
  39. FieldModel = "model"
  40. // FieldTaskStatus holds the string denoting the task_status field in the database.
  41. FieldTaskStatus = "task_status"
  42. // FieldRetryCount holds the string denoting the retry_count field in the database.
  43. FieldRetryCount = "retry_count"
  44. // FieldLastError holds the string denoting the last_error field in the database.
  45. FieldLastError = "last_error"
  46. // Table holds the table name of the compapiasynctask in the database.
  47. Table = "compapi_asynctask"
  48. )
  49. // Columns holds all SQL columns for compapiasynctask fields.
  50. var Columns = []string{
  51. FieldID,
  52. FieldCreatedAt,
  53. FieldUpdatedAt,
  54. FieldAuthToken,
  55. FieldEventType,
  56. FieldChatID,
  57. FieldResponseChatItemID,
  58. FieldOrganizationID,
  59. FieldOpenaiBase,
  60. FieldOpenaiKey,
  61. FieldRequestRaw,
  62. FieldResponseRaw,
  63. FieldCallbackURL,
  64. FieldCallbackResponseRaw,
  65. FieldModel,
  66. FieldTaskStatus,
  67. FieldRetryCount,
  68. FieldLastError,
  69. }
  70. // ValidColumn reports if the column name is valid (part of the table columns).
  71. func ValidColumn(column string) bool {
  72. for i := range Columns {
  73. if column == Columns[i] {
  74. return true
  75. }
  76. }
  77. return false
  78. }
  79. var (
  80. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  81. DefaultCreatedAt func() time.Time
  82. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  83. DefaultUpdatedAt func() time.Time
  84. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  85. UpdateDefaultUpdatedAt func() time.Time
  86. // DefaultEventType holds the default value on creation for the "event_type" field.
  87. DefaultEventType string
  88. // DefaultChatID holds the default value on creation for the "chat_id" field.
  89. DefaultChatID string
  90. // DefaultResponseChatItemID holds the default value on creation for the "response_chat_item_id" field.
  91. DefaultResponseChatItemID string
  92. // OrganizationIDValidator is a validator for the "organization_id" field. It is called by the builders before save.
  93. OrganizationIDValidator func(uint64) error
  94. // DefaultResponseRaw holds the default value on creation for the "response_raw" field.
  95. DefaultResponseRaw string
  96. // CallbackURLValidator is a validator for the "callback_url" field. It is called by the builders before save.
  97. CallbackURLValidator func(string) error
  98. // DefaultCallbackResponseRaw holds the default value on creation for the "callback_response_raw" field.
  99. DefaultCallbackResponseRaw string
  100. // DefaultModel holds the default value on creation for the "model" field.
  101. DefaultModel string
  102. // DefaultTaskStatus holds the default value on creation for the "task_status" field.
  103. DefaultTaskStatus int8
  104. // DefaultRetryCount holds the default value on creation for the "retry_count" field.
  105. DefaultRetryCount int8
  106. // DefaultLastError holds the default value on creation for the "last_error" field.
  107. DefaultLastError string
  108. )
  109. // OrderOption defines the ordering options for the CompapiAsynctask queries.
  110. type OrderOption func(*sql.Selector)
  111. // ByID orders the results by the id field.
  112. func ByID(opts ...sql.OrderTermOption) OrderOption {
  113. return sql.OrderByField(FieldID, opts...).ToFunc()
  114. }
  115. // ByCreatedAt orders the results by the created_at field.
  116. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  117. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  118. }
  119. // ByUpdatedAt orders the results by the updated_at field.
  120. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  121. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  122. }
  123. // ByAuthToken orders the results by the auth_token field.
  124. func ByAuthToken(opts ...sql.OrderTermOption) OrderOption {
  125. return sql.OrderByField(FieldAuthToken, opts...).ToFunc()
  126. }
  127. // ByEventType orders the results by the event_type field.
  128. func ByEventType(opts ...sql.OrderTermOption) OrderOption {
  129. return sql.OrderByField(FieldEventType, opts...).ToFunc()
  130. }
  131. // ByChatID orders the results by the chat_id field.
  132. func ByChatID(opts ...sql.OrderTermOption) OrderOption {
  133. return sql.OrderByField(FieldChatID, opts...).ToFunc()
  134. }
  135. // ByResponseChatItemID orders the results by the response_chat_item_id field.
  136. func ByResponseChatItemID(opts ...sql.OrderTermOption) OrderOption {
  137. return sql.OrderByField(FieldResponseChatItemID, opts...).ToFunc()
  138. }
  139. // ByOrganizationID orders the results by the organization_id field.
  140. func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption {
  141. return sql.OrderByField(FieldOrganizationID, opts...).ToFunc()
  142. }
  143. // ByOpenaiBase orders the results by the openai_base field.
  144. func ByOpenaiBase(opts ...sql.OrderTermOption) OrderOption {
  145. return sql.OrderByField(FieldOpenaiBase, opts...).ToFunc()
  146. }
  147. // ByOpenaiKey orders the results by the openai_key field.
  148. func ByOpenaiKey(opts ...sql.OrderTermOption) OrderOption {
  149. return sql.OrderByField(FieldOpenaiKey, opts...).ToFunc()
  150. }
  151. // ByRequestRaw orders the results by the request_raw field.
  152. func ByRequestRaw(opts ...sql.OrderTermOption) OrderOption {
  153. return sql.OrderByField(FieldRequestRaw, opts...).ToFunc()
  154. }
  155. // ByResponseRaw orders the results by the response_raw field.
  156. func ByResponseRaw(opts ...sql.OrderTermOption) OrderOption {
  157. return sql.OrderByField(FieldResponseRaw, opts...).ToFunc()
  158. }
  159. // ByCallbackURL orders the results by the callback_url field.
  160. func ByCallbackURL(opts ...sql.OrderTermOption) OrderOption {
  161. return sql.OrderByField(FieldCallbackURL, opts...).ToFunc()
  162. }
  163. // ByCallbackResponseRaw orders the results by the callback_response_raw field.
  164. func ByCallbackResponseRaw(opts ...sql.OrderTermOption) OrderOption {
  165. return sql.OrderByField(FieldCallbackResponseRaw, opts...).ToFunc()
  166. }
  167. // ByModel orders the results by the model field.
  168. func ByModel(opts ...sql.OrderTermOption) OrderOption {
  169. return sql.OrderByField(FieldModel, opts...).ToFunc()
  170. }
  171. // ByTaskStatus orders the results by the task_status field.
  172. func ByTaskStatus(opts ...sql.OrderTermOption) OrderOption {
  173. return sql.OrderByField(FieldTaskStatus, opts...).ToFunc()
  174. }
  175. // ByRetryCount orders the results by the retry_count field.
  176. func ByRetryCount(opts ...sql.OrderTermOption) OrderOption {
  177. return sql.OrderByField(FieldRetryCount, opts...).ToFunc()
  178. }
  179. // ByLastError orders the results by the last_error field.
  180. func ByLastError(opts ...sql.OrderTermOption) OrderOption {
  181. return sql.OrderByField(FieldLastError, opts...).ToFunc()
  182. }