securitysecret.go 2.7 KB

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