batchimageevent.go 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. // Code generated by ent, DO NOT EDIT.
  2. package batchimageevent
  3. import (
  4. "time"
  5. "entgo.io/ent/dialect/sql"
  6. )
  7. const (
  8. // Label holds the string label denoting the batchimageevent type in the database.
  9. Label = "batch_image_event"
  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. // FieldEventType holds the string denoting the event_type field in the database.
  15. FieldEventType = "event_type"
  16. // FieldPayload holds the string denoting the payload field in the database.
  17. FieldPayload = "payload"
  18. // FieldEventHash holds the string denoting the event_hash field in the database.
  19. FieldEventHash = "event_hash"
  20. // FieldCreatedAt holds the string denoting the created_at field in the database.
  21. FieldCreatedAt = "created_at"
  22. // Table holds the table name of the batchimageevent in the database.
  23. Table = "batch_image_events"
  24. )
  25. // Columns holds all SQL columns for batchimageevent fields.
  26. var Columns = []string{
  27. FieldID,
  28. FieldJobID,
  29. FieldEventType,
  30. FieldPayload,
  31. FieldEventHash,
  32. FieldCreatedAt,
  33. }
  34. // ValidColumn reports if the column name is valid (part of the table columns).
  35. func ValidColumn(column string) bool {
  36. for i := range Columns {
  37. if column == Columns[i] {
  38. return true
  39. }
  40. }
  41. return false
  42. }
  43. var (
  44. // JobIDValidator is a validator for the "job_id" field. It is called by the builders before save.
  45. JobIDValidator func(string) error
  46. // EventTypeValidator is a validator for the "event_type" field. It is called by the builders before save.
  47. EventTypeValidator func(string) error
  48. // EventHashValidator is a validator for the "event_hash" field. It is called by the builders before save.
  49. EventHashValidator func(string) error
  50. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  51. DefaultCreatedAt func() time.Time
  52. )
  53. // OrderOption defines the ordering options for the BatchImageEvent queries.
  54. type OrderOption func(*sql.Selector)
  55. // ByID orders the results by the id field.
  56. func ByID(opts ...sql.OrderTermOption) OrderOption {
  57. return sql.OrderByField(FieldID, opts...).ToFunc()
  58. }
  59. // ByJobID orders the results by the job_id field.
  60. func ByJobID(opts ...sql.OrderTermOption) OrderOption {
  61. return sql.OrderByField(FieldJobID, opts...).ToFunc()
  62. }
  63. // ByEventType orders the results by the event_type field.
  64. func ByEventType(opts ...sql.OrderTermOption) OrderOption {
  65. return sql.OrderByField(FieldEventType, opts...).ToFunc()
  66. }
  67. // ByEventHash orders the results by the event_hash field.
  68. func ByEventHash(opts ...sql.OrderTermOption) OrderOption {
  69. return sql.OrderByField(FieldEventHash, opts...).ToFunc()
  70. }
  71. // ByCreatedAt orders the results by the created_at field.
  72. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  73. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  74. }