// Code generated by ent, DO NOT EDIT. package admin import ( "time" "entgo.io/ent/dialect/sql" ) const ( // Label holds the string label denoting the admin type in the database. Label = "admin" // FieldID holds the string denoting the id field in the database. FieldID = "id" // FieldName holds the string denoting the name field in the database. FieldName = "name" // FieldEmail holds the string denoting the email field in the database. FieldEmail = "email" // FieldAvatar holds the string denoting the avatar field in the database. FieldAvatar = "avatar" // FieldAccess holds the string denoting the access field in the database. FieldAccess = "access" // FieldPassword holds the string denoting the password field in the database. FieldPassword = "password" // FieldCreateTime holds the string denoting the create_time field in the database. FieldCreateTime = "create_time" // FieldUpdateTime holds the string denoting the update_time field in the database. FieldUpdateTime = "update_time" // Table holds the table name of the admin in the database. Table = "admins" ) // Columns holds all SQL columns for admin fields. var Columns = []string{ FieldID, FieldName, FieldEmail, FieldAvatar, FieldAccess, FieldPassword, FieldCreateTime, FieldUpdateTime, } // 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 ( // DefaultName holds the default value on creation for the "name" field. DefaultName string // DefaultEmail holds the default value on creation for the "email" field. DefaultEmail string // DefaultAvatar holds the default value on creation for the "avatar" field. DefaultAvatar string // DefaultAccess holds the default value on creation for the "access" field. DefaultAccess string // DefaultPassword holds the default value on creation for the "password" field. DefaultPassword string // DefaultCreateTime holds the default value on creation for the "create_time" field. DefaultCreateTime func() time.Time // DefaultUpdateTime holds the default value on creation for the "update_time" field. DefaultUpdateTime func() time.Time // UpdateDefaultUpdateTime holds the default value on update for the "update_time" field. UpdateDefaultUpdateTime func() time.Time ) // OrderOption defines the ordering options for the Admin 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() } // ByName orders the results by the name field. func ByName(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldName, opts...).ToFunc() } // ByEmail orders the results by the email field. func ByEmail(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldEmail, opts...).ToFunc() } // ByAvatar orders the results by the avatar field. func ByAvatar(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldAvatar, opts...).ToFunc() } // ByAccess orders the results by the access field. func ByAccess(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldAccess, opts...).ToFunc() } // ByPassword orders the results by the password field. func ByPassword(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldPassword, opts...).ToFunc() } // ByCreateTime orders the results by the create_time field. func ByCreateTime(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldCreateTime, opts...).ToFunc() } // ByUpdateTime orders the results by the update_time field. func ByUpdateTime(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldUpdateTime, opts...).ToFunc() }