// Code generated by ent, DO NOT EDIT. package wx import ( "time" "entgo.io/ent" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" ) const ( // Label holds the string label denoting the wx type in the database. Label = "wx" // FieldID holds the string denoting the id field in the database. FieldID = "id" // FieldCreatedAt holds the string denoting the created_at field in the database. FieldCreatedAt = "created_at" // FieldUpdatedAt holds the string denoting the updated_at field in the database. FieldUpdatedAt = "updated_at" // FieldStatus holds the string denoting the status field in the database. FieldStatus = "status" // FieldDeletedAt holds the string denoting the deleted_at field in the database. FieldDeletedAt = "deleted_at" // FieldServerID holds the string denoting the server_id field in the database. FieldServerID = "server_id" // FieldPort holds the string denoting the port field in the database. FieldPort = "port" // FieldProcessID holds the string denoting the process_id field in the database. FieldProcessID = "process_id" // FieldCallback holds the string denoting the callback field in the database. FieldCallback = "callback" // FieldWxid holds the string denoting the wxid field in the database. FieldWxid = "wxid" // FieldAccount holds the string denoting the account field in the database. FieldAccount = "account" // FieldNickname holds the string denoting the nickname field in the database. FieldNickname = "nickname" // FieldTel holds the string denoting the tel field in the database. FieldTel = "tel" // FieldHeadBig holds the string denoting the head_big field in the database. FieldHeadBig = "head_big" // EdgeServer holds the string denoting the server edge name in mutations. EdgeServer = "server" // Table holds the table name of the wx in the database. Table = "wx" // ServerTable is the table that holds the server relation/edge. ServerTable = "wx" // ServerInverseTable is the table name for the Server entity. // It exists in this package in order to avoid circular dependency with the "server" package. ServerInverseTable = "server" // ServerColumn is the table column denoting the server relation/edge. ServerColumn = "server_id" ) // Columns holds all SQL columns for wx fields. var Columns = []string{ FieldID, FieldCreatedAt, FieldUpdatedAt, FieldStatus, FieldDeletedAt, FieldServerID, FieldPort, FieldProcessID, FieldCallback, FieldWxid, FieldAccount, FieldNickname, FieldTel, FieldHeadBig, } // 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 } // Note that the variables below are initialized by the runtime // package on the initialization of the application. Therefore, // it should be imported in the main as follows: // // import _ "wechat-api/ent/runtime" var ( Hooks [1]ent.Hook Interceptors [1]ent.Interceptor // DefaultCreatedAt holds the default value on creation for the "created_at" field. DefaultCreatedAt func() time.Time // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. DefaultUpdatedAt func() time.Time // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. UpdateDefaultUpdatedAt func() time.Time // DefaultStatus holds the default value on creation for the "status" field. DefaultStatus uint8 // DefaultServerID holds the default value on creation for the "server_id" field. DefaultServerID uint64 // DefaultPort holds the default value on creation for the "port" field. DefaultPort string // DefaultProcessID holds the default value on creation for the "process_id" field. DefaultProcessID string // DefaultCallback holds the default value on creation for the "callback" field. DefaultCallback string // DefaultWxid holds the default value on creation for the "wxid" field. DefaultWxid string // DefaultAccount holds the default value on creation for the "account" field. DefaultAccount string // DefaultNickname holds the default value on creation for the "nickname" field. DefaultNickname string // DefaultTel holds the default value on creation for the "tel" field. DefaultTel string // DefaultHeadBig holds the default value on creation for the "head_big" field. DefaultHeadBig string ) // OrderOption defines the ordering options for the Wx 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() } // ByCreatedAt orders the results by the created_at field. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() } // ByUpdatedAt orders the results by the updated_at field. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() } // ByStatus orders the results by the status field. func ByStatus(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldStatus, opts...).ToFunc() } // ByDeletedAt orders the results by the deleted_at field. func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() } // ByServerID orders the results by the server_id field. func ByServerID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldServerID, opts...).ToFunc() } // ByPort orders the results by the port field. func ByPort(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldPort, opts...).ToFunc() } // ByProcessID orders the results by the process_id field. func ByProcessID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldProcessID, opts...).ToFunc() } // ByCallback orders the results by the callback field. func ByCallback(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldCallback, opts...).ToFunc() } // ByWxid orders the results by the wxid field. func ByWxid(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldWxid, opts...).ToFunc() } // ByAccount orders the results by the account field. func ByAccount(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldAccount, opts...).ToFunc() } // ByNickname orders the results by the nickname field. func ByNickname(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldNickname, opts...).ToFunc() } // ByTel orders the results by the tel field. func ByTel(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldTel, opts...).ToFunc() } // ByHeadBig orders the results by the head_big field. func ByHeadBig(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldHeadBig, opts...).ToFunc() } // ByServerField orders the results by server field. func ByServerField(field string, opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newServerStep(), sql.OrderByField(field, opts...)) } } func newServerStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(ServerInverseTable, FieldID), sqlgraph.Edge(sqlgraph.M2O, true, ServerTable, ServerColumn), ) }