Documentation
¶
Index ¶
- Constants
- Variables
- func And(predicates ...predicate.Post) predicate.Post
- func Content(v string) predicate.Post
- func ContentContains(v string) predicate.Post
- func ContentContainsFold(v string) predicate.Post
- func ContentEQ(v string) predicate.Post
- func ContentEqualFold(v string) predicate.Post
- func ContentGT(v string) predicate.Post
- func ContentGTE(v string) predicate.Post
- func ContentHasPrefix(v string) predicate.Post
- func ContentHasSuffix(v string) predicate.Post
- func ContentIn(vs ...string) predicate.Post
- func ContentLT(v string) predicate.Post
- func ContentLTE(v string) predicate.Post
- func ContentNEQ(v string) predicate.Post
- func ContentNotIn(vs ...string) predicate.Post
- func HasComments() predicate.Post
- func HasCommentsWith(preds ...predicate.Comment) predicate.Post
- func HasUser() predicate.Post
- func HasUserWith(preds ...predicate.User) predicate.Post
- func ID(id uint) predicate.Post
- func IDEQ(id uint) predicate.Post
- func IDGT(id uint) predicate.Post
- func IDGTE(id uint) predicate.Post
- func IDIn(ids ...uint) predicate.Post
- func IDLT(id uint) predicate.Post
- func IDLTE(id uint) predicate.Post
- func IDNEQ(id uint) predicate.Post
- func IDNotIn(ids ...uint) predicate.Post
- func Not(p predicate.Post) predicate.Post
- func Or(predicates ...predicate.Post) predicate.Post
- func Title(v string) predicate.Post
- func TitleContains(v string) predicate.Post
- func TitleContainsFold(v string) predicate.Post
- func TitleEQ(v string) predicate.Post
- func TitleEqualFold(v string) predicate.Post
- func TitleGT(v string) predicate.Post
- func TitleGTE(v string) predicate.Post
- func TitleHasPrefix(v string) predicate.Post
- func TitleHasSuffix(v string) predicate.Post
- func TitleIn(vs ...string) predicate.Post
- func TitleLT(v string) predicate.Post
- func TitleLTE(v string) predicate.Post
- func TitleNEQ(v string) predicate.Post
- func TitleNotIn(vs ...string) predicate.Post
- func UserID(v uint) predicate.Post
- func UserIDEQ(v uint) predicate.Post
- func UserIDIn(vs ...uint) predicate.Post
- func UserIDNEQ(v uint) predicate.Post
- func UserIDNotIn(vs ...uint) predicate.Post
- func ValidColumn(column string) bool
- type OrderOption
- func ByComments(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption
- func ByCommentsCount(opts ...sql.OrderTermOption) OrderOption
- func ByContent(opts ...sql.OrderTermOption) OrderOption
- func ByID(opts ...sql.OrderTermOption) OrderOption
- func ByTitle(opts ...sql.OrderTermOption) OrderOption
- func ByUserField(field string, opts ...sql.OrderTermOption) OrderOption
- func ByUserID(opts ...sql.OrderTermOption) OrderOption
Constants ¶
const ( // Label holds the string label denoting the post type in the database. Label = "post" // FieldID holds the string denoting the id field in the database. FieldID = "id" // 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" // FieldUserID holds the string denoting the user_id field in the database. FieldUserID = "user_id" // EdgeUser holds the string denoting the user edge name in mutations. EdgeUser = "user" // EdgeComments holds the string denoting the comments edge name in mutations. EdgeComments = "comments" // Table holds the table name of the post in the database. Table = "posts" // UserTable is the table that holds the user relation/edge. UserTable = "posts" // 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 = "user_id" // CommentsTable is the table that holds the comments relation/edge. CommentsTable = "comments" // CommentsInverseTable is the table name for the Comment entity. // It exists in this package in order to avoid circular dependency with the "comment" package. CommentsInverseTable = "comments" // CommentsColumn is the table column denoting the comments relation/edge. CommentsColumn = "post_id" )
Variables ¶
var ( // TitleValidator is a validator for the "title" field. It is called by the builders before save. TitleValidator func(string) error // ContentValidator is a validator for the "content" field. It is called by the builders before save. ContentValidator func(string) error )
var Columns = []string{ FieldID, FieldTitle, FieldContent, FieldUserID, }
Columns holds all SQL columns for post fields.
Functions ¶
func Content ¶
Content applies equality check predicate on the "content" field. It's identical to ContentEQ.
func ContentContains ¶
ContentContains applies the Contains predicate on the "content" field.
func ContentContainsFold ¶
ContentContainsFold applies the ContainsFold predicate on the "content" field.
func ContentEqualFold ¶
ContentEqualFold applies the EqualFold predicate on the "content" field.
func ContentGTE ¶
ContentGTE applies the GTE predicate on the "content" field.
func ContentHasPrefix ¶
ContentHasPrefix applies the HasPrefix predicate on the "content" field.
func ContentHasSuffix ¶
ContentHasSuffix applies the HasSuffix predicate on the "content" field.
func ContentLTE ¶
ContentLTE applies the LTE predicate on the "content" field.
func ContentNEQ ¶
ContentNEQ applies the NEQ predicate on the "content" field.
func ContentNotIn ¶
ContentNotIn applies the NotIn predicate on the "content" field.
func HasComments ¶
HasComments applies the HasEdge predicate on the "comments" edge.
func HasCommentsWith ¶
HasCommentsWith applies the HasEdge predicate on the "comments" edge with a given conditions (other predicates).
func HasUserWith ¶
HasUserWith applies the HasEdge predicate on the "user" edge with a given conditions (other predicates).
func Title ¶
Title applies equality check predicate on the "title" field. It's identical to TitleEQ.
func TitleContains ¶
TitleContains applies the Contains predicate on the "title" field.
func TitleContainsFold ¶
TitleContainsFold applies the ContainsFold predicate on the "title" field.
func TitleEqualFold ¶
TitleEqualFold applies the EqualFold predicate on the "title" field.
func TitleHasPrefix ¶
TitleHasPrefix applies the HasPrefix predicate on the "title" field.
func TitleHasSuffix ¶
TitleHasSuffix applies the HasSuffix predicate on the "title" field.
func TitleNotIn ¶
TitleNotIn applies the NotIn predicate on the "title" field.
func UserID ¶
UserID applies equality check predicate on the "user_id" field. It's identical to UserIDEQ.
func UserIDNotIn ¶
UserIDNotIn applies the NotIn predicate on the "user_id" field.
func ValidColumn ¶
ValidColumn reports if the column name is valid (part of the table columns).
Types ¶
type OrderOption ¶
OrderOption defines the ordering options for the Post queries.
func ByComments ¶
func ByComments(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption
ByComments orders the results by comments terms.
func ByCommentsCount ¶
func ByCommentsCount(opts ...sql.OrderTermOption) OrderOption
ByCommentsCount orders the results by comments count.
func ByContent ¶
func ByContent(opts ...sql.OrderTermOption) OrderOption
ByContent orders the results by the content field.
func ByID ¶
func ByID(opts ...sql.OrderTermOption) OrderOption
ByID orders the results by the id field.
func ByTitle ¶
func ByTitle(opts ...sql.OrderTermOption) OrderOption
ByTitle orders the results by the title field.
func ByUserField ¶
func ByUserField(field string, opts ...sql.OrderTermOption) OrderOption
ByUserField orders the results by user field.
func ByUserID ¶
func ByUserID(opts ...sql.OrderTermOption) OrderOption
ByUserID orders the results by the user_id field.