123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- // Code generated by ent, DO NOT EDIT.
- package message
- import (
- "entgo.io/ent/dialect/sql"
- )
- const (
- // Label holds the string label denoting the message type in the database.
- Label = "message"
- // FieldID holds the string denoting the id field in the database.
- FieldID = "id"
- // FieldWxWxid holds the string denoting the wx_wxid field in the database.
- FieldWxWxid = "wx_wxid"
- // FieldWxid holds the string denoting the wxid field in the database.
- FieldWxid = "wxid"
- // FieldContent holds the string denoting the content field in the database.
- FieldContent = "content"
- // Table holds the table name of the message in the database.
- Table = "messages"
- )
- // Columns holds all SQL columns for message fields.
- var Columns = []string{
- FieldID,
- FieldWxWxid,
- FieldWxid,
- FieldContent,
- }
- // ValidColumn reports if the column name is valid (part of the table columns).
- func ValidColumn(column string) bool {
- for i := range Columns {
- if column == Columns[i] {
- return true
- }
- }
- return false
- }
- var (
- // DefaultWxWxid holds the default value on creation for the "wx_wxid" field.
- DefaultWxWxid string
- // DefaultWxid holds the default value on creation for the "wxid" field.
- DefaultWxid string
- // DefaultContent holds the default value on creation for the "content" field.
- DefaultContent string
- )
- // OrderOption defines the ordering options for the Message queries.
- type OrderOption func(*sql.Selector)
- // ByID orders the results by the id field.
- func ByID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldID, opts...).ToFunc()
- }
- // ByWxWxid orders the results by the wx_wxid field.
- func ByWxWxid(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldWxWxid, opts...).ToFunc()
- }
- // ByWxid orders the results by the wxid field.
- func ByWxid(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldWxid, opts...).ToFunc()
- }
- // ByContent orders the results by the content field.
- func ByContent(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldContent, opts...).ToFunc()
- }
|