Documentation
¶
Index ¶
- Constants
- Variables
- func And(predicates ...predicate.Post) predicate.Post
- func HasOwner() predicate.Post
- func HasOwnerWith(preds ...predicate.User) predicate.Post
- func HasPinners() predicate.Post
- func HasPinnersWith(preds ...predicate.User) predicate.Post
- func ID(id int) predicate.Post
- func IDEQ(id int) predicate.Post
- func IDGT(id int) predicate.Post
- func IDGTE(id int) predicate.Post
- func IDIn(ids ...int) predicate.Post
- func IDLT(id int) predicate.Post
- func IDLTE(id int) predicate.Post
- func IDNEQ(id int) predicate.Post
- func IDNotIn(ids ...int) predicate.Post
- func Not(p predicate.Post) predicate.Post
- func Or(predicates ...predicate.Post) predicate.Post
- func Published(v bool) predicate.Post
- func PublishedEQ(v bool) predicate.Post
- func PublishedNEQ(v bool) 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 ValidColumn(column string) bool
- type OrderOption
- func ByID(opts ...sql.OrderTermOption) OrderOption
- func ByOwnerField(field string, opts ...sql.OrderTermOption) OrderOption
- func ByPinners(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption
- func ByPinnersCount(opts ...sql.OrderTermOption) OrderOption
- func ByPublished(opts ...sql.OrderTermOption) OrderOption
- func ByTitle(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" // FieldPublished holds the string denoting the published field in the database. FieldPublished = "published" // EdgeOwner holds the string denoting the owner edge name in mutations. EdgeOwner = "owner" // EdgePinners holds the string denoting the pinners edge name in mutations. EdgePinners = "pinners" // Table holds the table name of the post in the database. Table = "posts" // OwnerTable is the table that holds the owner relation/edge. OwnerTable = "posts" // OwnerInverseTable is the table name for the User entity. // It exists in this package in order to avoid circular dependency with the "user" package. OwnerInverseTable = "users" // OwnerColumn is the table column denoting the owner relation/edge. OwnerColumn = "user_posts" // PinnersTable is the table that holds the pinners relation/edge. PinnersTable = "users" // PinnersInverseTable is the table name for the User entity. // It exists in this package in order to avoid circular dependency with the "user" package. PinnersInverseTable = "users" // PinnersColumn is the table column denoting the pinners relation/edge. PinnersColumn = "user_pinned_post" )
Variables ¶
var Columns = []string{ FieldID, FieldTitle, FieldPublished, }
Columns holds all SQL columns for post fields.
var ( // DefaultPublished holds the default value on creation for the "published" field. DefaultPublished bool )
var ForeignKeys = []string{
"user_posts",
}
ForeignKeys holds the SQL foreign-keys that are owned by the "posts" table and are not defined as standalone fields in the schema.
Functions ¶
func HasOwnerWith ¶
HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates).
func HasPinners ¶
HasPinners applies the HasEdge predicate on the "pinners" edge.
func HasPinnersWith ¶
HasPinnersWith applies the HasEdge predicate on the "pinners" edge with a given conditions (other predicates).
func Published ¶
Published applies equality check predicate on the "published" field. It's identical to PublishedEQ.
func PublishedEQ ¶
PublishedEQ applies the EQ predicate on the "published" field.
func PublishedNEQ ¶
PublishedNEQ applies the NEQ predicate on the "published" field.
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 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 ByID ¶
func ByID(opts ...sql.OrderTermOption) OrderOption
ByID orders the results by the id field.
func ByOwnerField ¶
func ByOwnerField(field string, opts ...sql.OrderTermOption) OrderOption
ByOwnerField orders the results by owner field.
func ByPinners ¶
func ByPinners(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption
ByPinners orders the results by pinners terms.
func ByPinnersCount ¶
func ByPinnersCount(opts ...sql.OrderTermOption) OrderOption
ByPinnersCount orders the results by pinners count.
func ByPublished ¶
func ByPublished(opts ...sql.OrderTermOption) OrderOption
ByPublished orders the results by the published field.
func ByTitle ¶
func ByTitle(opts ...sql.OrderTermOption) OrderOption
ByTitle orders the results by the title field.