// Code generated by ent, DO NOT EDIT. package site import ( "entgo.io/ent/dialect/sql" ) const ( // Label holds the string label denoting the site type in the database. Label = "site" // 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" // FieldURL holds the string denoting the url field in the database. FieldURL = "url" // FieldIcon holds the string denoting the icon field in the database. FieldIcon = "icon" // FieldSortOrder holds the string denoting the sort_order field in the database. FieldSortOrder = "sort_order" // Table holds the table name of the site in the database. Table = "sites" ) // Columns holds all SQL columns for site fields. var Columns = []string{ FieldID, FieldName, FieldURL, FieldIcon, FieldSortOrder, } // 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 ( // DefaultSortOrder holds the default value on creation for the "sort_order" field. DefaultSortOrder int ) // OrderOption defines the ordering options for the Site 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() } // ByURL orders the results by the url field. func ByURL(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldURL, opts...).ToFunc() } // ByIcon orders the results by the icon field. func ByIcon(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldIcon, opts...).ToFunc() } // BySortOrder orders the results by the sort_order field. func BySortOrder(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldSortOrder, opts...).ToFunc() }