compapiasynctask.go 7.5 KB

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