usagecleanuptask.go 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. // Code generated by ent, DO NOT EDIT.
  2. package usagecleanuptask
  3. import (
  4. "time"
  5. "entgo.io/ent/dialect/sql"
  6. )
  7. const (
  8. // Label holds the string label denoting the usagecleanuptask type in the database.
  9. Label = "usage_cleanup_task"
  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. // FieldStatus holds the string denoting the status field in the database.
  17. FieldStatus = "status"
  18. // FieldFilters holds the string denoting the filters field in the database.
  19. FieldFilters = "filters"
  20. // FieldCreatedBy holds the string denoting the created_by field in the database.
  21. FieldCreatedBy = "created_by"
  22. // FieldDeletedRows holds the string denoting the deleted_rows field in the database.
  23. FieldDeletedRows = "deleted_rows"
  24. // FieldErrorMessage holds the string denoting the error_message field in the database.
  25. FieldErrorMessage = "error_message"
  26. // FieldCanceledBy holds the string denoting the canceled_by field in the database.
  27. FieldCanceledBy = "canceled_by"
  28. // FieldCanceledAt holds the string denoting the canceled_at field in the database.
  29. FieldCanceledAt = "canceled_at"
  30. // FieldStartedAt holds the string denoting the started_at field in the database.
  31. FieldStartedAt = "started_at"
  32. // FieldFinishedAt holds the string denoting the finished_at field in the database.
  33. FieldFinishedAt = "finished_at"
  34. // Table holds the table name of the usagecleanuptask in the database.
  35. Table = "usage_cleanup_tasks"
  36. )
  37. // Columns holds all SQL columns for usagecleanuptask fields.
  38. var Columns = []string{
  39. FieldID,
  40. FieldCreatedAt,
  41. FieldUpdatedAt,
  42. FieldStatus,
  43. FieldFilters,
  44. FieldCreatedBy,
  45. FieldDeletedRows,
  46. FieldErrorMessage,
  47. FieldCanceledBy,
  48. FieldCanceledAt,
  49. FieldStartedAt,
  50. FieldFinishedAt,
  51. }
  52. // ValidColumn reports if the column name is valid (part of the table columns).
  53. func ValidColumn(column string) bool {
  54. for i := range Columns {
  55. if column == Columns[i] {
  56. return true
  57. }
  58. }
  59. return false
  60. }
  61. var (
  62. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  63. DefaultCreatedAt func() time.Time
  64. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  65. DefaultUpdatedAt func() time.Time
  66. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  67. UpdateDefaultUpdatedAt func() time.Time
  68. // StatusValidator is a validator for the "status" field. It is called by the builders before save.
  69. StatusValidator func(string) error
  70. // DefaultDeletedRows holds the default value on creation for the "deleted_rows" field.
  71. DefaultDeletedRows int64
  72. )
  73. // OrderOption defines the ordering options for the UsageCleanupTask queries.
  74. type OrderOption func(*sql.Selector)
  75. // ByID orders the results by the id field.
  76. func ByID(opts ...sql.OrderTermOption) OrderOption {
  77. return sql.OrderByField(FieldID, opts...).ToFunc()
  78. }
  79. // ByCreatedAt orders the results by the created_at field.
  80. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  81. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  82. }
  83. // ByUpdatedAt orders the results by the updated_at field.
  84. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  85. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  86. }
  87. // ByStatus orders the results by the status field.
  88. func ByStatus(opts ...sql.OrderTermOption) OrderOption {
  89. return sql.OrderByField(FieldStatus, opts...).ToFunc()
  90. }
  91. // ByCreatedBy orders the results by the created_by field.
  92. func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption {
  93. return sql.OrderByField(FieldCreatedBy, opts...).ToFunc()
  94. }
  95. // ByDeletedRows orders the results by the deleted_rows field.
  96. func ByDeletedRows(opts ...sql.OrderTermOption) OrderOption {
  97. return sql.OrderByField(FieldDeletedRows, opts...).ToFunc()
  98. }
  99. // ByErrorMessage orders the results by the error_message field.
  100. func ByErrorMessage(opts ...sql.OrderTermOption) OrderOption {
  101. return sql.OrderByField(FieldErrorMessage, opts...).ToFunc()
  102. }
  103. // ByCanceledBy orders the results by the canceled_by field.
  104. func ByCanceledBy(opts ...sql.OrderTermOption) OrderOption {
  105. return sql.OrderByField(FieldCanceledBy, opts...).ToFunc()
  106. }
  107. // ByCanceledAt orders the results by the canceled_at field.
  108. func ByCanceledAt(opts ...sql.OrderTermOption) OrderOption {
  109. return sql.OrderByField(FieldCanceledAt, opts...).ToFunc()
  110. }
  111. // ByStartedAt orders the results by the started_at field.
  112. func ByStartedAt(opts ...sql.OrderTermOption) OrderOption {
  113. return sql.OrderByField(FieldStartedAt, opts...).ToFunc()
  114. }
  115. // ByFinishedAt orders the results by the finished_at field.
  116. func ByFinishedAt(opts ...sql.OrderTermOption) OrderOption {
  117. return sql.OrderByField(FieldFinishedAt, opts...).ToFunc()
  118. }