// Code generated by ent, DO NOT EDIT. package posts import ( "time" "entgo.io/ent/dialect/sql" ) const ( // Label holds the string label denoting the posts type in the database. Label = "posts" // FieldID holds the string denoting the id field in the database. FieldID = "id" // FieldAuthorID holds the string denoting the author_id field in the database. FieldAuthorID = "author_id" // FieldAuthorRole holds the string denoting the author_role field in the database. FieldAuthorRole = "author_role" // FieldTitle holds the string denoting the title field in the database. FieldTitle = "title" // FieldContent holds the string denoting the content field in the database. FieldContent = "content" // FieldImages holds the string denoting the images field in the database. FieldImages = "images" // FieldTags holds the string denoting the tags field in the database. FieldTags = "tags" // FieldLinkedOrderID holds the string denoting the linked_order_id field in the database. FieldLinkedOrderID = "linked_order_id" // FieldQuotedPostID holds the string denoting the quoted_post_id field in the database. FieldQuotedPostID = "quoted_post_id" // FieldLikeCount holds the string denoting the like_count field in the database. FieldLikeCount = "like_count" // FieldCommentCount holds the string denoting the comment_count field in the database. FieldCommentCount = "comment_count" // FieldPinned holds the string denoting the pinned field in the database. FieldPinned = "pinned" // FieldCreatedAt holds the string denoting the created_at field in the database. FieldCreatedAt = "created_at" // FieldUpdatedAt holds the string denoting the updated_at field in the database. FieldUpdatedAt = "updated_at" // FieldDeletedAt holds the string denoting the deleted_at field in the database. FieldDeletedAt = "deleted_at" // Table holds the table name of the posts in the database. Table = "posts" ) // Columns holds all SQL columns for posts fields. var Columns = []string{ FieldID, FieldAuthorID, FieldAuthorRole, FieldTitle, FieldContent, FieldImages, FieldTags, FieldLinkedOrderID, FieldQuotedPostID, FieldLikeCount, FieldCommentCount, FieldPinned, FieldCreatedAt, FieldUpdatedAt, FieldDeletedAt, } // 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 ( // DefaultAuthorRole holds the default value on creation for the "author_role" field. DefaultAuthorRole string // AuthorRoleValidator is a validator for the "author_role" field. It is called by the builders before save. AuthorRoleValidator func(string) error // TitleValidator is a validator for the "title" field. It is called by the builders before save. TitleValidator func(string) error // DefaultLikeCount holds the default value on creation for the "like_count" field. DefaultLikeCount int // DefaultCommentCount holds the default value on creation for the "comment_count" field. DefaultCommentCount int // DefaultPinned holds the default value on creation for the "pinned" field. DefaultPinned bool // DefaultCreatedAt holds the default value on creation for the "created_at" field. DefaultCreatedAt func() time.Time // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. DefaultUpdatedAt func() time.Time // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. UpdateDefaultUpdatedAt func() time.Time ) // OrderOption defines the ordering options for the Posts 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() } // ByAuthorID orders the results by the author_id field. func ByAuthorID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldAuthorID, opts...).ToFunc() } // ByAuthorRole orders the results by the author_role field. func ByAuthorRole(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldAuthorRole, opts...).ToFunc() } // ByTitle orders the results by the title field. func ByTitle(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldTitle, opts...).ToFunc() } // ByContent orders the results by the content field. func ByContent(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldContent, opts...).ToFunc() } // ByImages orders the results by the images field. func ByImages(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldImages, opts...).ToFunc() } // ByTags orders the results by the tags field. func ByTags(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldTags, opts...).ToFunc() } // ByLinkedOrderID orders the results by the linked_order_id field. func ByLinkedOrderID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldLinkedOrderID, opts...).ToFunc() } // ByQuotedPostID orders the results by the quoted_post_id field. func ByQuotedPostID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldQuotedPostID, opts...).ToFunc() } // ByLikeCount orders the results by the like_count field. func ByLikeCount(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldLikeCount, opts...).ToFunc() } // ByCommentCount orders the results by the comment_count field. func ByCommentCount(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldCommentCount, opts...).ToFunc() } // ByPinned orders the results by the pinned field. func ByPinned(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldPinned, opts...).ToFunc() } // ByCreatedAt orders the results by the created_at field. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() } // ByUpdatedAt orders the results by the updated_at field. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() } // ByDeletedAt orders the results by the deleted_at field. func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() }