batchimageitem.go 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. // Code generated by ent, DO NOT EDIT.
  2. package batchimageitem
  3. import (
  4. "time"
  5. "entgo.io/ent/dialect/sql"
  6. )
  7. const (
  8. // Label holds the string label denoting the batchimageitem type in the database.
  9. Label = "batch_image_item"
  10. // FieldID holds the string denoting the id field in the database.
  11. FieldID = "id"
  12. // FieldJobID holds the string denoting the job_id field in the database.
  13. FieldJobID = "job_id"
  14. // FieldCustomID holds the string denoting the custom_id field in the database.
  15. FieldCustomID = "custom_id"
  16. // FieldStatus holds the string denoting the status field in the database.
  17. FieldStatus = "status"
  18. // FieldRequestHash holds the string denoting the request_hash field in the database.
  19. FieldRequestHash = "request_hash"
  20. // FieldPromptPreview holds the string denoting the prompt_preview field in the database.
  21. FieldPromptPreview = "prompt_preview"
  22. // FieldProviderSourceObject holds the string denoting the provider_source_object field in the database.
  23. FieldProviderSourceObject = "provider_source_object"
  24. // FieldSourceLineNumber holds the string denoting the source_line_number field in the database.
  25. FieldSourceLineNumber = "source_line_number"
  26. // FieldSourceByteOffset holds the string denoting the source_byte_offset field in the database.
  27. FieldSourceByteOffset = "source_byte_offset"
  28. // FieldSourceByteLength holds the string denoting the source_byte_length field in the database.
  29. FieldSourceByteLength = "source_byte_length"
  30. // FieldMimeType holds the string denoting the mime_type field in the database.
  31. FieldMimeType = "mime_type"
  32. // FieldFileExtension holds the string denoting the file_extension field in the database.
  33. FieldFileExtension = "file_extension"
  34. // FieldImageCount holds the string denoting the image_count field in the database.
  35. FieldImageCount = "image_count"
  36. // FieldErrorCode holds the string denoting the error_code field in the database.
  37. FieldErrorCode = "error_code"
  38. // FieldErrorMessage holds the string denoting the error_message field in the database.
  39. FieldErrorMessage = "error_message"
  40. // FieldBilledAmount holds the string denoting the billed_amount field in the database.
  41. FieldBilledAmount = "billed_amount"
  42. // FieldCreatedAt holds the string denoting the created_at field in the database.
  43. FieldCreatedAt = "created_at"
  44. // FieldIndexedAt holds the string denoting the indexed_at field in the database.
  45. FieldIndexedAt = "indexed_at"
  46. // Table holds the table name of the batchimageitem in the database.
  47. Table = "batch_image_items"
  48. )
  49. // Columns holds all SQL columns for batchimageitem fields.
  50. var Columns = []string{
  51. FieldID,
  52. FieldJobID,
  53. FieldCustomID,
  54. FieldStatus,
  55. FieldRequestHash,
  56. FieldPromptPreview,
  57. FieldProviderSourceObject,
  58. FieldSourceLineNumber,
  59. FieldSourceByteOffset,
  60. FieldSourceByteLength,
  61. FieldMimeType,
  62. FieldFileExtension,
  63. FieldImageCount,
  64. FieldErrorCode,
  65. FieldErrorMessage,
  66. FieldBilledAmount,
  67. FieldCreatedAt,
  68. FieldIndexedAt,
  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. // JobIDValidator is a validator for the "job_id" field. It is called by the builders before save.
  81. JobIDValidator func(string) error
  82. // CustomIDValidator is a validator for the "custom_id" field. It is called by the builders before save.
  83. CustomIDValidator func(string) error
  84. // StatusValidator is a validator for the "status" field. It is called by the builders before save.
  85. StatusValidator func(string) error
  86. // RequestHashValidator is a validator for the "request_hash" field. It is called by the builders before save.
  87. RequestHashValidator func(string) error
  88. // ProviderSourceObjectValidator is a validator for the "provider_source_object" field. It is called by the builders before save.
  89. ProviderSourceObjectValidator func(string) error
  90. // MimeTypeValidator is a validator for the "mime_type" field. It is called by the builders before save.
  91. MimeTypeValidator func(string) error
  92. // FileExtensionValidator is a validator for the "file_extension" field. It is called by the builders before save.
  93. FileExtensionValidator func(string) error
  94. // DefaultImageCount holds the default value on creation for the "image_count" field.
  95. DefaultImageCount int
  96. // ErrorCodeValidator is a validator for the "error_code" field. It is called by the builders before save.
  97. ErrorCodeValidator func(string) error
  98. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  99. DefaultCreatedAt func() time.Time
  100. )
  101. // OrderOption defines the ordering options for the BatchImageItem queries.
  102. type OrderOption func(*sql.Selector)
  103. // ByID orders the results by the id field.
  104. func ByID(opts ...sql.OrderTermOption) OrderOption {
  105. return sql.OrderByField(FieldID, opts...).ToFunc()
  106. }
  107. // ByJobID orders the results by the job_id field.
  108. func ByJobID(opts ...sql.OrderTermOption) OrderOption {
  109. return sql.OrderByField(FieldJobID, opts...).ToFunc()
  110. }
  111. // ByCustomID orders the results by the custom_id field.
  112. func ByCustomID(opts ...sql.OrderTermOption) OrderOption {
  113. return sql.OrderByField(FieldCustomID, opts...).ToFunc()
  114. }
  115. // ByStatus orders the results by the status field.
  116. func ByStatus(opts ...sql.OrderTermOption) OrderOption {
  117. return sql.OrderByField(FieldStatus, opts...).ToFunc()
  118. }
  119. // ByRequestHash orders the results by the request_hash field.
  120. func ByRequestHash(opts ...sql.OrderTermOption) OrderOption {
  121. return sql.OrderByField(FieldRequestHash, opts...).ToFunc()
  122. }
  123. // ByPromptPreview orders the results by the prompt_preview field.
  124. func ByPromptPreview(opts ...sql.OrderTermOption) OrderOption {
  125. return sql.OrderByField(FieldPromptPreview, opts...).ToFunc()
  126. }
  127. // ByProviderSourceObject orders the results by the provider_source_object field.
  128. func ByProviderSourceObject(opts ...sql.OrderTermOption) OrderOption {
  129. return sql.OrderByField(FieldProviderSourceObject, opts...).ToFunc()
  130. }
  131. // BySourceLineNumber orders the results by the source_line_number field.
  132. func BySourceLineNumber(opts ...sql.OrderTermOption) OrderOption {
  133. return sql.OrderByField(FieldSourceLineNumber, opts...).ToFunc()
  134. }
  135. // BySourceByteOffset orders the results by the source_byte_offset field.
  136. func BySourceByteOffset(opts ...sql.OrderTermOption) OrderOption {
  137. return sql.OrderByField(FieldSourceByteOffset, opts...).ToFunc()
  138. }
  139. // BySourceByteLength orders the results by the source_byte_length field.
  140. func BySourceByteLength(opts ...sql.OrderTermOption) OrderOption {
  141. return sql.OrderByField(FieldSourceByteLength, opts...).ToFunc()
  142. }
  143. // ByMimeType orders the results by the mime_type field.
  144. func ByMimeType(opts ...sql.OrderTermOption) OrderOption {
  145. return sql.OrderByField(FieldMimeType, opts...).ToFunc()
  146. }
  147. // ByFileExtension orders the results by the file_extension field.
  148. func ByFileExtension(opts ...sql.OrderTermOption) OrderOption {
  149. return sql.OrderByField(FieldFileExtension, opts...).ToFunc()
  150. }
  151. // ByImageCount orders the results by the image_count field.
  152. func ByImageCount(opts ...sql.OrderTermOption) OrderOption {
  153. return sql.OrderByField(FieldImageCount, opts...).ToFunc()
  154. }
  155. // ByErrorCode orders the results by the error_code field.
  156. func ByErrorCode(opts ...sql.OrderTermOption) OrderOption {
  157. return sql.OrderByField(FieldErrorCode, opts...).ToFunc()
  158. }
  159. // ByErrorMessage orders the results by the error_message field.
  160. func ByErrorMessage(opts ...sql.OrderTermOption) OrderOption {
  161. return sql.OrderByField(FieldErrorMessage, opts...).ToFunc()
  162. }
  163. // ByBilledAmount orders the results by the billed_amount field.
  164. func ByBilledAmount(opts ...sql.OrderTermOption) OrderOption {
  165. return sql.OrderByField(FieldBilledAmount, opts...).ToFunc()
  166. }
  167. // ByCreatedAt orders the results by the created_at field.
  168. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  169. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  170. }
  171. // ByIndexedAt orders the results by the indexed_at field.
  172. func ByIndexedAt(opts ...sql.OrderTermOption) OrderOption {
  173. return sql.OrderByField(FieldIndexedAt, opts...).ToFunc()
  174. }