authidentitychannel.go 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. // Code generated by ent, DO NOT EDIT.
  2. package authidentitychannel
  3. import (
  4. "time"
  5. "entgo.io/ent/dialect/sql"
  6. "entgo.io/ent/dialect/sql/sqlgraph"
  7. )
  8. const (
  9. // Label holds the string label denoting the authidentitychannel type in the database.
  10. Label = "auth_identity_channel"
  11. // FieldID holds the string denoting the id field in the database.
  12. FieldID = "id"
  13. // FieldCreatedAt holds the string denoting the created_at field in the database.
  14. FieldCreatedAt = "created_at"
  15. // FieldUpdatedAt holds the string denoting the updated_at field in the database.
  16. FieldUpdatedAt = "updated_at"
  17. // FieldIdentityID holds the string denoting the identity_id field in the database.
  18. FieldIdentityID = "identity_id"
  19. // FieldProviderType holds the string denoting the provider_type field in the database.
  20. FieldProviderType = "provider_type"
  21. // FieldProviderKey holds the string denoting the provider_key field in the database.
  22. FieldProviderKey = "provider_key"
  23. // FieldChannel holds the string denoting the channel field in the database.
  24. FieldChannel = "channel"
  25. // FieldChannelAppID holds the string denoting the channel_app_id field in the database.
  26. FieldChannelAppID = "channel_app_id"
  27. // FieldChannelSubject holds the string denoting the channel_subject field in the database.
  28. FieldChannelSubject = "channel_subject"
  29. // FieldMetadata holds the string denoting the metadata field in the database.
  30. FieldMetadata = "metadata"
  31. // EdgeIdentity holds the string denoting the identity edge name in mutations.
  32. EdgeIdentity = "identity"
  33. // Table holds the table name of the authidentitychannel in the database.
  34. Table = "auth_identity_channels"
  35. // IdentityTable is the table that holds the identity relation/edge.
  36. IdentityTable = "auth_identity_channels"
  37. // IdentityInverseTable is the table name for the AuthIdentity entity.
  38. // It exists in this package in order to avoid circular dependency with the "authidentity" package.
  39. IdentityInverseTable = "auth_identities"
  40. // IdentityColumn is the table column denoting the identity relation/edge.
  41. IdentityColumn = "identity_id"
  42. )
  43. // Columns holds all SQL columns for authidentitychannel fields.
  44. var Columns = []string{
  45. FieldID,
  46. FieldCreatedAt,
  47. FieldUpdatedAt,
  48. FieldIdentityID,
  49. FieldProviderType,
  50. FieldProviderKey,
  51. FieldChannel,
  52. FieldChannelAppID,
  53. FieldChannelSubject,
  54. FieldMetadata,
  55. }
  56. // ValidColumn reports if the column name is valid (part of the table columns).
  57. func ValidColumn(column string) bool {
  58. for i := range Columns {
  59. if column == Columns[i] {
  60. return true
  61. }
  62. }
  63. return false
  64. }
  65. var (
  66. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  67. DefaultCreatedAt func() time.Time
  68. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  69. DefaultUpdatedAt func() time.Time
  70. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  71. UpdateDefaultUpdatedAt func() time.Time
  72. // ProviderTypeValidator is a validator for the "provider_type" field. It is called by the builders before save.
  73. ProviderTypeValidator func(string) error
  74. // ProviderKeyValidator is a validator for the "provider_key" field. It is called by the builders before save.
  75. ProviderKeyValidator func(string) error
  76. // ChannelValidator is a validator for the "channel" field. It is called by the builders before save.
  77. ChannelValidator func(string) error
  78. // ChannelAppIDValidator is a validator for the "channel_app_id" field. It is called by the builders before save.
  79. ChannelAppIDValidator func(string) error
  80. // ChannelSubjectValidator is a validator for the "channel_subject" field. It is called by the builders before save.
  81. ChannelSubjectValidator func(string) error
  82. // DefaultMetadata holds the default value on creation for the "metadata" field.
  83. DefaultMetadata func() map[string]interface{}
  84. )
  85. // OrderOption defines the ordering options for the AuthIdentityChannel queries.
  86. type OrderOption func(*sql.Selector)
  87. // ByID orders the results by the id field.
  88. func ByID(opts ...sql.OrderTermOption) OrderOption {
  89. return sql.OrderByField(FieldID, opts...).ToFunc()
  90. }
  91. // ByCreatedAt orders the results by the created_at field.
  92. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  93. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  94. }
  95. // ByUpdatedAt orders the results by the updated_at field.
  96. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  97. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  98. }
  99. // ByIdentityID orders the results by the identity_id field.
  100. func ByIdentityID(opts ...sql.OrderTermOption) OrderOption {
  101. return sql.OrderByField(FieldIdentityID, opts...).ToFunc()
  102. }
  103. // ByProviderType orders the results by the provider_type field.
  104. func ByProviderType(opts ...sql.OrderTermOption) OrderOption {
  105. return sql.OrderByField(FieldProviderType, opts...).ToFunc()
  106. }
  107. // ByProviderKey orders the results by the provider_key field.
  108. func ByProviderKey(opts ...sql.OrderTermOption) OrderOption {
  109. return sql.OrderByField(FieldProviderKey, opts...).ToFunc()
  110. }
  111. // ByChannel orders the results by the channel field.
  112. func ByChannel(opts ...sql.OrderTermOption) OrderOption {
  113. return sql.OrderByField(FieldChannel, opts...).ToFunc()
  114. }
  115. // ByChannelAppID orders the results by the channel_app_id field.
  116. func ByChannelAppID(opts ...sql.OrderTermOption) OrderOption {
  117. return sql.OrderByField(FieldChannelAppID, opts...).ToFunc()
  118. }
  119. // ByChannelSubject orders the results by the channel_subject field.
  120. func ByChannelSubject(opts ...sql.OrderTermOption) OrderOption {
  121. return sql.OrderByField(FieldChannelSubject, opts...).ToFunc()
  122. }
  123. // ByIdentityField orders the results by identity field.
  124. func ByIdentityField(field string, opts ...sql.OrderTermOption) OrderOption {
  125. return func(s *sql.Selector) {
  126. sqlgraph.OrderByNeighborTerms(s, newIdentityStep(), sql.OrderByField(field, opts...))
  127. }
  128. }
  129. func newIdentityStep() *sqlgraph.Step {
  130. return sqlgraph.NewStep(
  131. sqlgraph.From(Table, FieldID),
  132. sqlgraph.To(IdentityInverseTable, FieldID),
  133. sqlgraph.Edge(sqlgraph.M2O, true, IdentityTable, IdentityColumn),
  134. )
  135. }