// Code generated by ent, DO NOT EDIT. package refreshtoken import ( "time" "entgo.io/ent/dialect/sql" ) const ( // Label holds the string label denoting the refreshtoken type in the database. Label = "refresh_token" // FieldID holds the string denoting the id field in the database. FieldID = "id" // FieldUserID holds the string denoting the user_id field in the database. FieldUserID = "user_id" // FieldTokenHash holds the string denoting the token_hash field in the database. FieldTokenHash = "token_hash" // FieldExpiresAt holds the string denoting the expires_at field in the database. FieldExpiresAt = "expires_at" // FieldCreatedAt holds the string denoting the created_at field in the database. FieldCreatedAt = "created_at" // Table holds the table name of the refreshtoken in the database. Table = "refresh_tokens" ) // Columns holds all SQL columns for refreshtoken fields. var Columns = []string{ FieldID, FieldUserID, FieldTokenHash, FieldExpiresAt, FieldCreatedAt, } // 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 ( // UserIDValidator is a validator for the "user_id" field. It is called by the builders before save. UserIDValidator func(string) error // TokenHashValidator is a validator for the "token_hash" field. It is called by the builders before save. TokenHashValidator func(string) error // DefaultCreatedAt holds the default value on creation for the "created_at" field. DefaultCreatedAt func() time.Time ) // OrderOption defines the ordering options for the RefreshToken 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() } // ByUserID orders the results by the user_id field. func ByUserID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldUserID, opts...).ToFunc() } // ByTokenHash orders the results by the token_hash field. func ByTokenHash(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldTokenHash, opts...).ToFunc() } // ByExpiresAt orders the results by the expires_at field. func ByExpiresAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldExpiresAt, opts...).ToFunc() } // ByCreatedAt orders the results by the created_at field. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() }