message.go 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // Code generated by ent, DO NOT EDIT.
  2. package message
  3. import (
  4. "entgo.io/ent/dialect/sql"
  5. )
  6. const (
  7. // Label holds the string label denoting the message type in the database.
  8. Label = "message"
  9. // FieldID holds the string denoting the id field in the database.
  10. FieldID = "id"
  11. // FieldWxWxid holds the string denoting the wx_wxid field in the database.
  12. FieldWxWxid = "wx_wxid"
  13. // FieldWxid holds the string denoting the wxid field in the database.
  14. FieldWxid = "wxid"
  15. // FieldContent holds the string denoting the content field in the database.
  16. FieldContent = "content"
  17. // Table holds the table name of the message in the database.
  18. Table = "messages"
  19. )
  20. // Columns holds all SQL columns for message fields.
  21. var Columns = []string{
  22. FieldID,
  23. FieldWxWxid,
  24. FieldWxid,
  25. FieldContent,
  26. }
  27. // ValidColumn reports if the column name is valid (part of the table columns).
  28. func ValidColumn(column string) bool {
  29. for i := range Columns {
  30. if column == Columns[i] {
  31. return true
  32. }
  33. }
  34. return false
  35. }
  36. var (
  37. // DefaultWxWxid holds the default value on creation for the "wx_wxid" field.
  38. DefaultWxWxid string
  39. // DefaultWxid holds the default value on creation for the "wxid" field.
  40. DefaultWxid string
  41. // DefaultContent holds the default value on creation for the "content" field.
  42. DefaultContent string
  43. )
  44. // OrderOption defines the ordering options for the Message queries.
  45. type OrderOption func(*sql.Selector)
  46. // ByID orders the results by the id field.
  47. func ByID(opts ...sql.OrderTermOption) OrderOption {
  48. return sql.OrderByField(FieldID, opts...).ToFunc()
  49. }
  50. // ByWxWxid orders the results by the wx_wxid field.
  51. func ByWxWxid(opts ...sql.OrderTermOption) OrderOption {
  52. return sql.OrderByField(FieldWxWxid, opts...).ToFunc()
  53. }
  54. // ByWxid orders the results by the wxid field.
  55. func ByWxid(opts ...sql.OrderTermOption) OrderOption {
  56. return sql.OrderByField(FieldWxid, opts...).ToFunc()
  57. }
  58. // ByContent orders the results by the content field.
  59. func ByContent(opts ...sql.OrderTermOption) OrderOption {
  60. return sql.OrderByField(FieldContent, opts...).ToFunc()
  61. }