// Code generated by ent, DO NOT EDIT. package searchquery import ( "time" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "github.com/google/uuid" ) const ( // Label holds the string label denoting the searchquery type in the database. Label = "search_query" // FieldID holds the string denoting the id field in the database. FieldID = "id" // FieldQuery holds the string denoting the query field in the database. FieldQuery = "query" // FieldCreated holds the string denoting the created field in the database. FieldCreated = "created" // FieldOwner holds the string denoting the owner field in the database. FieldOwner = "owner" // EdgeUser holds the string denoting the user edge name in mutations. EdgeUser = "user" // Table holds the table name of the searchquery in the database. Table = "search_queries" // UserTable is the table that holds the user relation/edge. UserTable = "search_queries" // UserInverseTable is the table name for the User entity. // It exists in this package in order to avoid circular dependency with the "user" package. UserInverseTable = "users" // UserColumn is the table column denoting the user relation/edge. UserColumn = "owner" ) // Columns holds all SQL columns for searchquery fields. var Columns = []string{ FieldID, FieldQuery, FieldCreated, FieldOwner, } // 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 ( // QueryValidator is a validator for the "query" field. It is called by the builders before save. QueryValidator func(string) error // DefaultCreated holds the default value on creation for the "created" field. DefaultCreated func() time.Time // DefaultID holds the default value on creation for the "id" field. DefaultID func() uuid.UUID ) // OrderOption defines the ordering options for the SearchQuery 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() } // ByQuery orders the results by the query field. func ByQuery(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldQuery, opts...).ToFunc() } // ByCreated orders the results by the created field. func ByCreated(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldCreated, opts...).ToFunc() } // ByOwner orders the results by the owner field. func ByOwner(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldOwner, opts...).ToFunc() } // ByUserField orders the results by user field. func ByUserField(field string, opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newUserStep(), sql.OrderByField(field, opts...)) } } func newUserStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(UserInverseTable, FieldID), sqlgraph.Edge(sqlgraph.M2O, true, UserTable, UserColumn), ) }