Documentation ¶
Index ¶
- Constants
- Variables
- func And(predicates ...predicate.Post) predicate.Post
- func AuthorID(v uuid.UUID) predicate.Post
- func AuthorIDEQ(v uuid.UUID) predicate.Post
- func AuthorIDIn(vs ...uuid.UUID) predicate.Post
- func AuthorIDNEQ(v uuid.UUID) predicate.Post
- func AuthorIDNotIn(vs ...uuid.UUID) predicate.Post
- func CreatedAt(v time.Time) predicate.Post
- func CreatedAtEQ(v time.Time) predicate.Post
- func CreatedAtGT(v time.Time) predicate.Post
- func CreatedAtGTE(v time.Time) predicate.Post
- func CreatedAtIn(vs ...time.Time) predicate.Post
- func CreatedAtLT(v time.Time) predicate.Post
- func CreatedAtLTE(v time.Time) predicate.Post
- func CreatedAtNEQ(v time.Time) predicate.Post
- func CreatedAtNotIn(vs ...time.Time) predicate.Post
- func HasAuthor() predicate.Post
- func HasAuthorWith(preds ...predicate.User) predicate.Post
- func HasComments() predicate.Post
- func HasCommentsWith(preds ...predicate.Comment) predicate.Post
- func HasImage() predicate.Post
- func HasImageWith(preds ...predicate.File) predicate.Post
- func HasNotifications() predicate.Post
- func HasNotificationsWith(preds ...predicate.Notification) predicate.Post
- func HasReactions() predicate.Post
- func HasReactionsWith(preds ...predicate.Reaction) predicate.Post
- func ID(id uuid.UUID) predicate.Post
- func IDEQ(id uuid.UUID) predicate.Post
- func IDGT(id uuid.UUID) predicate.Post
- func IDGTE(id uuid.UUID) predicate.Post
- func IDIn(ids ...uuid.UUID) predicate.Post
- func IDLT(id uuid.UUID) predicate.Post
- func IDLTE(id uuid.UUID) predicate.Post
- func IDNEQ(id uuid.UUID) predicate.Post
- func IDNotIn(ids ...uuid.UUID) predicate.Post
- func ImageID(v uuid.UUID) predicate.Post
- func ImageIDEQ(v uuid.UUID) predicate.Post
- func ImageIDIn(vs ...uuid.UUID) predicate.Post
- func ImageIDIsNil() predicate.Post
- func ImageIDNEQ(v uuid.UUID) predicate.Post
- func ImageIDNotIn(vs ...uuid.UUID) predicate.Post
- func ImageIDNotNil() predicate.Post
- func Not(p predicate.Post) predicate.Post
- func Or(predicates ...predicate.Post) predicate.Post
- func Slug(v string) predicate.Post
- func SlugContains(v string) predicate.Post
- func SlugContainsFold(v string) predicate.Post
- func SlugEQ(v string) predicate.Post
- func SlugEqualFold(v string) predicate.Post
- func SlugGT(v string) predicate.Post
- func SlugGTE(v string) predicate.Post
- func SlugHasPrefix(v string) predicate.Post
- func SlugHasSuffix(v string) predicate.Post
- func SlugIn(vs ...string) predicate.Post
- func SlugLT(v string) predicate.Post
- func SlugLTE(v string) predicate.Post
- func SlugNEQ(v string) predicate.Post
- func SlugNotIn(vs ...string) predicate.Post
- func Text(v string) predicate.Post
- func TextContains(v string) predicate.Post
- func TextContainsFold(v string) predicate.Post
- func TextEQ(v string) predicate.Post
- func TextEqualFold(v string) predicate.Post
- func TextGT(v string) predicate.Post
- func TextGTE(v string) predicate.Post
- func TextHasPrefix(v string) predicate.Post
- func TextHasSuffix(v string) predicate.Post
- func TextIn(vs ...string) predicate.Post
- func TextLT(v string) predicate.Post
- func TextLTE(v string) predicate.Post
- func TextNEQ(v string) predicate.Post
- func TextNotIn(vs ...string) predicate.Post
- func UpdatedAt(v time.Time) predicate.Post
- func UpdatedAtEQ(v time.Time) predicate.Post
- func UpdatedAtGT(v time.Time) predicate.Post
- func UpdatedAtGTE(v time.Time) predicate.Post
- func UpdatedAtIn(vs ...time.Time) predicate.Post
- func UpdatedAtLT(v time.Time) predicate.Post
- func UpdatedAtLTE(v time.Time) predicate.Post
- func UpdatedAtNEQ(v time.Time) predicate.Post
- func UpdatedAtNotIn(vs ...time.Time) predicate.Post
- func ValidColumn(column string) bool
- type OrderOption
- func ByAuthorField(field string, opts ...sql.OrderTermOption) OrderOption
- func ByAuthorID(opts ...sql.OrderTermOption) OrderOption
- func ByComments(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption
- func ByCommentsCount(opts ...sql.OrderTermOption) OrderOption
- func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption
- func ByID(opts ...sql.OrderTermOption) OrderOption
- func ByImageField(field string, opts ...sql.OrderTermOption) OrderOption
- func ByImageID(opts ...sql.OrderTermOption) OrderOption
- func ByNotifications(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption
- func ByNotificationsCount(opts ...sql.OrderTermOption) OrderOption
- func ByReactions(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption
- func ByReactionsCount(opts ...sql.OrderTermOption) OrderOption
- func BySlug(opts ...sql.OrderTermOption) OrderOption
- func ByText(opts ...sql.OrderTermOption) OrderOption
- func ByUpdatedAt(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" // 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" // FieldText holds the string denoting the text field in the database. FieldText = "text" // FieldSlug holds the string denoting the slug field in the database. FieldSlug = "slug" // FieldAuthorID holds the string denoting the author_id field in the database. FieldAuthorID = "author_id" // FieldImageID holds the string denoting the image_id field in the database. FieldImageID = "image_id" // EdgeReactions holds the string denoting the reactions edge name in mutations. EdgeReactions = "reactions" // EdgeAuthor holds the string denoting the author edge name in mutations. EdgeAuthor = "author" // EdgeImage holds the string denoting the image edge name in mutations. EdgeImage = "image" // EdgeComments holds the string denoting the comments edge name in mutations. EdgeComments = "comments" // EdgeNotifications holds the string denoting the notifications edge name in mutations. EdgeNotifications = "notifications" // Table holds the table name of the post in the database. Table = "posts" // ReactionsTable is the table that holds the reactions relation/edge. ReactionsTable = "reactions" // ReactionsInverseTable is the table name for the Reaction entity. // It exists in this package in order to avoid circular dependency with the "reaction" package. ReactionsInverseTable = "reactions" // ReactionsColumn is the table column denoting the reactions relation/edge. ReactionsColumn = "post_id" // AuthorTable is the table that holds the author relation/edge. AuthorTable = "posts" // AuthorInverseTable is the table name for the User entity. // It exists in this package in order to avoid circular dependency with the "user" package. AuthorInverseTable = "users" // AuthorColumn is the table column denoting the author relation/edge. AuthorColumn = "author_id" // ImageTable is the table that holds the image relation/edge. ImageTable = "posts" // ImageInverseTable is the table name for the File entity. // It exists in this package in order to avoid circular dependency with the "file" package. ImageInverseTable = "files" // ImageColumn is the table column denoting the image relation/edge. ImageColumn = "image_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" // NotificationsTable is the table that holds the notifications relation/edge. NotificationsTable = "notifications" // NotificationsInverseTable is the table name for the Notification entity. // It exists in this package in order to avoid circular dependency with the "notification" package. NotificationsInverseTable = "notifications" // NotificationsColumn is the table column denoting the notifications relation/edge. NotificationsColumn = "post_id" )
Variables ¶
var ( // 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 // TextValidator is a validator for the "text" field. It is called by the builders before save. TextValidator func(string) error // SlugValidator is a validator for the "slug" field. It is called by the builders before save. SlugValidator func(string) error // DefaultID holds the default value on creation for the "id" field. DefaultID func() uuid.UUID )
var Columns = []string{ FieldID, FieldCreatedAt, FieldUpdatedAt, FieldText, FieldSlug, FieldAuthorID, FieldImageID, }
Columns holds all SQL columns for post fields.
Functions ¶
func AuthorID ¶
AuthorID applies equality check predicate on the "author_id" field. It's identical to AuthorIDEQ.
func AuthorIDEQ ¶
AuthorIDEQ applies the EQ predicate on the "author_id" field.
func AuthorIDIn ¶
AuthorIDIn applies the In predicate on the "author_id" field.
func AuthorIDNEQ ¶
AuthorIDNEQ applies the NEQ predicate on the "author_id" field.
func AuthorIDNotIn ¶
AuthorIDNotIn applies the NotIn predicate on the "author_id" field.
func CreatedAt ¶
CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
func CreatedAtEQ ¶
CreatedAtEQ applies the EQ predicate on the "created_at" field.
func CreatedAtGT ¶
CreatedAtGT applies the GT predicate on the "created_at" field.
func CreatedAtGTE ¶
CreatedAtGTE applies the GTE predicate on the "created_at" field.
func CreatedAtIn ¶
CreatedAtIn applies the In predicate on the "created_at" field.
func CreatedAtLT ¶
CreatedAtLT applies the LT predicate on the "created_at" field.
func CreatedAtLTE ¶
CreatedAtLTE applies the LTE predicate on the "created_at" field.
func CreatedAtNEQ ¶
CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
func CreatedAtNotIn ¶
CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
func HasAuthorWith ¶
HasAuthorWith applies the HasEdge predicate on the "author" edge with a given conditions (other predicates).
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 HasImageWith ¶
HasImageWith applies the HasEdge predicate on the "image" edge with a given conditions (other predicates).
func HasNotifications ¶
HasNotifications applies the HasEdge predicate on the "notifications" edge.
func HasNotificationsWith ¶
func HasNotificationsWith(preds ...predicate.Notification) predicate.Post
HasNotificationsWith applies the HasEdge predicate on the "notifications" edge with a given conditions (other predicates).
func HasReactions ¶
HasReactions applies the HasEdge predicate on the "reactions" edge.
func HasReactionsWith ¶
HasReactionsWith applies the HasEdge predicate on the "reactions" edge with a given conditions (other predicates).
func ImageID ¶
ImageID applies equality check predicate on the "image_id" field. It's identical to ImageIDEQ.
func ImageIDIsNil ¶
ImageIDIsNil applies the IsNil predicate on the "image_id" field.
func ImageIDNEQ ¶
ImageIDNEQ applies the NEQ predicate on the "image_id" field.
func ImageIDNotIn ¶
ImageIDNotIn applies the NotIn predicate on the "image_id" field.
func ImageIDNotNil ¶
ImageIDNotNil applies the NotNil predicate on the "image_id" field.
func SlugContains ¶
SlugContains applies the Contains predicate on the "slug" field.
func SlugContainsFold ¶
SlugContainsFold applies the ContainsFold predicate on the "slug" field.
func SlugEqualFold ¶
SlugEqualFold applies the EqualFold predicate on the "slug" field.
func SlugHasPrefix ¶
SlugHasPrefix applies the HasPrefix predicate on the "slug" field.
func SlugHasSuffix ¶
SlugHasSuffix applies the HasSuffix predicate on the "slug" field.
func TextContains ¶
TextContains applies the Contains predicate on the "text" field.
func TextContainsFold ¶
TextContainsFold applies the ContainsFold predicate on the "text" field.
func TextEqualFold ¶
TextEqualFold applies the EqualFold predicate on the "text" field.
func TextHasPrefix ¶
TextHasPrefix applies the HasPrefix predicate on the "text" field.
func TextHasSuffix ¶
TextHasSuffix applies the HasSuffix predicate on the "text" field.
func UpdatedAt ¶
UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.
func UpdatedAtEQ ¶
UpdatedAtEQ applies the EQ predicate on the "updated_at" field.
func UpdatedAtGT ¶
UpdatedAtGT applies the GT predicate on the "updated_at" field.
func UpdatedAtGTE ¶
UpdatedAtGTE applies the GTE predicate on the "updated_at" field.
func UpdatedAtIn ¶
UpdatedAtIn applies the In predicate on the "updated_at" field.
func UpdatedAtLT ¶
UpdatedAtLT applies the LT predicate on the "updated_at" field.
func UpdatedAtLTE ¶
UpdatedAtLTE applies the LTE predicate on the "updated_at" field.
func UpdatedAtNEQ ¶
UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.
func UpdatedAtNotIn ¶
UpdatedAtNotIn applies the NotIn predicate on the "updated_at" 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 ByAuthorField ¶
func ByAuthorField(field string, opts ...sql.OrderTermOption) OrderOption
ByAuthorField orders the results by author field.
func ByAuthorID ¶
func ByAuthorID(opts ...sql.OrderTermOption) OrderOption
ByAuthorID orders the results by the author_id field.
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 ByCreatedAt ¶
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption
ByCreatedAt orders the results by the created_at field.
func ByID ¶
func ByID(opts ...sql.OrderTermOption) OrderOption
ByID orders the results by the id field.
func ByImageField ¶
func ByImageField(field string, opts ...sql.OrderTermOption) OrderOption
ByImageField orders the results by image field.
func ByImageID ¶
func ByImageID(opts ...sql.OrderTermOption) OrderOption
ByImageID orders the results by the image_id field.
func ByNotifications ¶
func ByNotifications(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption
ByNotifications orders the results by notifications terms.
func ByNotificationsCount ¶
func ByNotificationsCount(opts ...sql.OrderTermOption) OrderOption
ByNotificationsCount orders the results by notifications count.
func ByReactions ¶
func ByReactions(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption
ByReactions orders the results by reactions terms.
func ByReactionsCount ¶
func ByReactionsCount(opts ...sql.OrderTermOption) OrderOption
ByReactionsCount orders the results by reactions count.
func BySlug ¶
func BySlug(opts ...sql.OrderTermOption) OrderOption
BySlug orders the results by the slug field.
func ByText ¶
func ByText(opts ...sql.OrderTermOption) OrderOption
ByText orders the results by the text field.
func ByUpdatedAt ¶
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption
ByUpdatedAt orders the results by the updated_at field.