usagetotal.go 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. // Code generated by ent, DO NOT EDIT.
  2. package usagetotal
  3. import (
  4. "time"
  5. "entgo.io/ent/dialect/sql"
  6. )
  7. const (
  8. // Label holds the string label denoting the usagetotal type in the database.
  9. Label = "usage_total"
  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. // FieldType holds the string denoting the type field in the database.
  19. FieldType = "type"
  20. // FieldBotID holds the string denoting the bot_id field in the database.
  21. FieldBotID = "bot_id"
  22. // FieldTotalTokens holds the string denoting the total_tokens field in the database.
  23. FieldTotalTokens = "total_tokens"
  24. // FieldStartIndex holds the string denoting the start_index field in the database.
  25. FieldStartIndex = "start_index"
  26. // FieldEndIndex holds the string denoting the end_index field in the database.
  27. FieldEndIndex = "end_index"
  28. // FieldOrganizationID holds the string denoting the organization_id field in the database.
  29. FieldOrganizationID = "organization_id"
  30. // Table holds the table name of the usagetotal in the database.
  31. Table = "usage_total"
  32. )
  33. // Columns holds all SQL columns for usagetotal fields.
  34. var Columns = []string{
  35. FieldID,
  36. FieldCreatedAt,
  37. FieldUpdatedAt,
  38. FieldStatus,
  39. FieldType,
  40. FieldBotID,
  41. FieldTotalTokens,
  42. FieldStartIndex,
  43. FieldEndIndex,
  44. FieldOrganizationID,
  45. }
  46. // ValidColumn reports if the column name is valid (part of the table columns).
  47. func ValidColumn(column string) bool {
  48. for i := range Columns {
  49. if column == Columns[i] {
  50. return true
  51. }
  52. }
  53. return false
  54. }
  55. var (
  56. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  57. DefaultCreatedAt func() time.Time
  58. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  59. DefaultUpdatedAt func() time.Time
  60. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  61. UpdateDefaultUpdatedAt func() time.Time
  62. // DefaultStatus holds the default value on creation for the "status" field.
  63. DefaultStatus uint8
  64. // DefaultType holds the default value on creation for the "type" field.
  65. DefaultType int
  66. // DefaultBotID holds the default value on creation for the "bot_id" field.
  67. DefaultBotID string
  68. // DefaultTotalTokens holds the default value on creation for the "total_tokens" field.
  69. DefaultTotalTokens uint64
  70. // DefaultStartIndex holds the default value on creation for the "start_index" field.
  71. DefaultStartIndex uint64
  72. // DefaultEndIndex holds the default value on creation for the "end_index" field.
  73. DefaultEndIndex uint64
  74. // DefaultOrganizationID holds the default value on creation for the "organization_id" field.
  75. DefaultOrganizationID uint64
  76. )
  77. // OrderOption defines the ordering options for the UsageTotal queries.
  78. type OrderOption func(*sql.Selector)
  79. // ByID orders the results by the id field.
  80. func ByID(opts ...sql.OrderTermOption) OrderOption {
  81. return sql.OrderByField(FieldID, opts...).ToFunc()
  82. }
  83. // ByCreatedAt orders the results by the created_at field.
  84. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  85. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  86. }
  87. // ByUpdatedAt orders the results by the updated_at field.
  88. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  89. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  90. }
  91. // ByStatus orders the results by the status field.
  92. func ByStatus(opts ...sql.OrderTermOption) OrderOption {
  93. return sql.OrderByField(FieldStatus, opts...).ToFunc()
  94. }
  95. // ByType orders the results by the type field.
  96. func ByType(opts ...sql.OrderTermOption) OrderOption {
  97. return sql.OrderByField(FieldType, opts...).ToFunc()
  98. }
  99. // ByBotID orders the results by the bot_id field.
  100. func ByBotID(opts ...sql.OrderTermOption) OrderOption {
  101. return sql.OrderByField(FieldBotID, opts...).ToFunc()
  102. }
  103. // ByTotalTokens orders the results by the total_tokens field.
  104. func ByTotalTokens(opts ...sql.OrderTermOption) OrderOption {
  105. return sql.OrderByField(FieldTotalTokens, opts...).ToFunc()
  106. }
  107. // ByStartIndex orders the results by the start_index field.
  108. func ByStartIndex(opts ...sql.OrderTermOption) OrderOption {
  109. return sql.OrderByField(FieldStartIndex, opts...).ToFunc()
  110. }
  111. // ByEndIndex orders the results by the end_index field.
  112. func ByEndIndex(opts ...sql.OrderTermOption) OrderOption {
  113. return sql.OrderByField(FieldEndIndex, opts...).ToFunc()
  114. }
  115. // ByOrganizationID orders the results by the organization_id field.
  116. func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption {
  117. return sql.OrderByField(FieldOrganizationID, opts...).ToFunc()
  118. }