// Copyright 2019-present Facebook Inc. All rights reserved. // This source code is licensed under the Apache 2.0 license found // in the LICENSE file in the root directory of this source tree. // Code generated by ent, DO NOT EDIT. package media import ( "entgo.io/ent/dialect/sql" ) const ( // Label holds the string label denoting the media type in the database. Label = "media" // FieldID holds the string denoting the id field in the database. FieldID = "id" // FieldSource holds the string denoting the source field in the database. FieldSource = "source" // FieldSourceURI holds the string denoting the source_uri field in the database. FieldSourceURI = "source_uri" // FieldText holds the string denoting the text field in the database. FieldText = "text" // Table holds the table name of the media in the database. Table = "media" ) // Columns holds all SQL columns for media fields. var Columns = []string{ FieldID, FieldSource, FieldSourceURI, FieldText, } // 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 } // OrderOption defines the ordering options for the Media 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() } // BySource orders the results by the source field. func BySource(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldSource, opts...).ToFunc() } // BySourceURI orders the results by the source_uri field. func BySourceURI(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldSourceURI, opts...).ToFunc() } // ByText orders the results by the text field. func ByText(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldText, opts...).ToFunc() }