compositemodelroute.go 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. // Code generated by ent, DO NOT EDIT.
  2. package compositemodelroute
  3. import (
  4. "time"
  5. "entgo.io/ent"
  6. "entgo.io/ent/dialect/sql"
  7. "entgo.io/ent/dialect/sql/sqlgraph"
  8. )
  9. const (
  10. // Label holds the string label denoting the compositemodelroute type in the database.
  11. Label = "composite_model_route"
  12. // FieldID holds the string denoting the id field in the database.
  13. FieldID = "id"
  14. // FieldCreatedAt holds the string denoting the created_at field in the database.
  15. FieldCreatedAt = "created_at"
  16. // FieldUpdatedAt holds the string denoting the updated_at field in the database.
  17. FieldUpdatedAt = "updated_at"
  18. // FieldDeletedAt holds the string denoting the deleted_at field in the database.
  19. FieldDeletedAt = "deleted_at"
  20. // FieldGroupID holds the string denoting the group_id field in the database.
  21. FieldGroupID = "group_id"
  22. // FieldPublicModel holds the string denoting the public_model field in the database.
  23. FieldPublicModel = "public_model"
  24. // FieldMatchType holds the string denoting the match_type field in the database.
  25. FieldMatchType = "match_type"
  26. // FieldTargetPlatform holds the string denoting the target_platform field in the database.
  27. FieldTargetPlatform = "target_platform"
  28. // FieldUpstreamModel holds the string denoting the upstream_model field in the database.
  29. FieldUpstreamModel = "upstream_model"
  30. // FieldEndpoint holds the string denoting the endpoint field in the database.
  31. FieldEndpoint = "endpoint"
  32. // FieldPriority holds the string denoting the priority field in the database.
  33. FieldPriority = "priority"
  34. // FieldEnabled holds the string denoting the enabled field in the database.
  35. FieldEnabled = "enabled"
  36. // FieldNotes holds the string denoting the notes field in the database.
  37. FieldNotes = "notes"
  38. // EdgeGroup holds the string denoting the group edge name in mutations.
  39. EdgeGroup = "group"
  40. // Table holds the table name of the compositemodelroute in the database.
  41. Table = "composite_model_routes"
  42. // GroupTable is the table that holds the group relation/edge.
  43. GroupTable = "composite_model_routes"
  44. // GroupInverseTable is the table name for the Group entity.
  45. // It exists in this package in order to avoid circular dependency with the "group" package.
  46. GroupInverseTable = "groups"
  47. // GroupColumn is the table column denoting the group relation/edge.
  48. GroupColumn = "group_id"
  49. )
  50. // Columns holds all SQL columns for compositemodelroute fields.
  51. var Columns = []string{
  52. FieldID,
  53. FieldCreatedAt,
  54. FieldUpdatedAt,
  55. FieldDeletedAt,
  56. FieldGroupID,
  57. FieldPublicModel,
  58. FieldMatchType,
  59. FieldTargetPlatform,
  60. FieldUpstreamModel,
  61. FieldEndpoint,
  62. FieldPriority,
  63. FieldEnabled,
  64. FieldNotes,
  65. }
  66. // ValidColumn reports if the column name is valid (part of the table columns).
  67. func ValidColumn(column string) bool {
  68. for i := range Columns {
  69. if column == Columns[i] {
  70. return true
  71. }
  72. }
  73. return false
  74. }
  75. // Note that the variables below are initialized by the runtime
  76. // package on the initialization of the application. Therefore,
  77. // it should be imported in the main as follows:
  78. //
  79. // import _ "github.com/Wei-Shaw/sub2api/ent/runtime"
  80. var (
  81. Hooks [1]ent.Hook
  82. Interceptors [1]ent.Interceptor
  83. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  84. DefaultCreatedAt func() time.Time
  85. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  86. DefaultUpdatedAt func() time.Time
  87. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  88. UpdateDefaultUpdatedAt func() time.Time
  89. // PublicModelValidator is a validator for the "public_model" field. It is called by the builders before save.
  90. PublicModelValidator func(string) error
  91. // DefaultMatchType holds the default value on creation for the "match_type" field.
  92. DefaultMatchType string
  93. // MatchTypeValidator is a validator for the "match_type" field. It is called by the builders before save.
  94. MatchTypeValidator func(string) error
  95. // DefaultTargetPlatform holds the default value on creation for the "target_platform" field.
  96. DefaultTargetPlatform string
  97. // TargetPlatformValidator is a validator for the "target_platform" field. It is called by the builders before save.
  98. TargetPlatformValidator func(string) error
  99. // DefaultUpstreamModel holds the default value on creation for the "upstream_model" field.
  100. DefaultUpstreamModel string
  101. // UpstreamModelValidator is a validator for the "upstream_model" field. It is called by the builders before save.
  102. UpstreamModelValidator func(string) error
  103. // DefaultEndpoint holds the default value on creation for the "endpoint" field.
  104. DefaultEndpoint string
  105. // EndpointValidator is a validator for the "endpoint" field. It is called by the builders before save.
  106. EndpointValidator func(string) error
  107. // DefaultPriority holds the default value on creation for the "priority" field.
  108. DefaultPriority int
  109. // DefaultEnabled holds the default value on creation for the "enabled" field.
  110. DefaultEnabled bool
  111. )
  112. // OrderOption defines the ordering options for the CompositeModelRoute queries.
  113. type OrderOption func(*sql.Selector)
  114. // ByID orders the results by the id field.
  115. func ByID(opts ...sql.OrderTermOption) OrderOption {
  116. return sql.OrderByField(FieldID, opts...).ToFunc()
  117. }
  118. // ByCreatedAt orders the results by the created_at field.
  119. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  120. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  121. }
  122. // ByUpdatedAt orders the results by the updated_at field.
  123. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  124. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  125. }
  126. // ByDeletedAt orders the results by the deleted_at field.
  127. func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
  128. return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
  129. }
  130. // ByGroupID orders the results by the group_id field.
  131. func ByGroupID(opts ...sql.OrderTermOption) OrderOption {
  132. return sql.OrderByField(FieldGroupID, opts...).ToFunc()
  133. }
  134. // ByPublicModel orders the results by the public_model field.
  135. func ByPublicModel(opts ...sql.OrderTermOption) OrderOption {
  136. return sql.OrderByField(FieldPublicModel, opts...).ToFunc()
  137. }
  138. // ByMatchType orders the results by the match_type field.
  139. func ByMatchType(opts ...sql.OrderTermOption) OrderOption {
  140. return sql.OrderByField(FieldMatchType, opts...).ToFunc()
  141. }
  142. // ByTargetPlatform orders the results by the target_platform field.
  143. func ByTargetPlatform(opts ...sql.OrderTermOption) OrderOption {
  144. return sql.OrderByField(FieldTargetPlatform, opts...).ToFunc()
  145. }
  146. // ByUpstreamModel orders the results by the upstream_model field.
  147. func ByUpstreamModel(opts ...sql.OrderTermOption) OrderOption {
  148. return sql.OrderByField(FieldUpstreamModel, opts...).ToFunc()
  149. }
  150. // ByEndpoint orders the results by the endpoint field.
  151. func ByEndpoint(opts ...sql.OrderTermOption) OrderOption {
  152. return sql.OrderByField(FieldEndpoint, opts...).ToFunc()
  153. }
  154. // ByPriority orders the results by the priority field.
  155. func ByPriority(opts ...sql.OrderTermOption) OrderOption {
  156. return sql.OrderByField(FieldPriority, opts...).ToFunc()
  157. }
  158. // ByEnabled orders the results by the enabled field.
  159. func ByEnabled(opts ...sql.OrderTermOption) OrderOption {
  160. return sql.OrderByField(FieldEnabled, opts...).ToFunc()
  161. }
  162. // ByNotes orders the results by the notes field.
  163. func ByNotes(opts ...sql.OrderTermOption) OrderOption {
  164. return sql.OrderByField(FieldNotes, opts...).ToFunc()
  165. }
  166. // ByGroupField orders the results by group field.
  167. func ByGroupField(field string, opts ...sql.OrderTermOption) OrderOption {
  168. return func(s *sql.Selector) {
  169. sqlgraph.OrderByNeighborTerms(s, newGroupStep(), sql.OrderByField(field, opts...))
  170. }
  171. }
  172. func newGroupStep() *sqlgraph.Step {
  173. return sqlgraph.NewStep(
  174. sqlgraph.From(Table, FieldID),
  175. sqlgraph.To(GroupInverseTable, FieldID),
  176. sqlgraph.Edge(sqlgraph.M2O, false, GroupTable, GroupColumn),
  177. )
  178. }