post

package
v1.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
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

Columns holds all SQL columns for post fields.

View Source
var (
	// DefaultPublished holds the default value on creation for the "published" field.
	DefaultPublished bool
)
View Source
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 And

func And(predicates ...predicate.Post) predicate.Post

And groups predicates with the AND operator between them.

func HasOwner

func HasOwner() predicate.Post

HasOwner applies the HasEdge predicate on the "owner" edge.

func HasOwnerWith

func HasOwnerWith(preds ...predicate.User) predicate.Post

HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates).

func HasPinners

func HasPinners() predicate.Post

HasPinners applies the HasEdge predicate on the "pinners" edge.

func HasPinnersWith

func HasPinnersWith(preds ...predicate.User) predicate.Post

HasPinnersWith applies the HasEdge predicate on the "pinners" edge with a given conditions (other predicates).

func ID

func ID(id int) predicate.Post

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id int) predicate.Post

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id int) predicate.Post

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id int) predicate.Post

IDGTE applies the GTE predicate on the ID field.

func IDIn

func IDIn(ids ...int) predicate.Post

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id int) predicate.Post

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id int) predicate.Post

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id int) predicate.Post

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

func IDNotIn(ids ...int) predicate.Post

IDNotIn applies the NotIn predicate on the ID field.

func Not

Not applies the not operator on the given predicate.

func Or

func Or(predicates ...predicate.Post) predicate.Post

Or groups predicates with the OR operator between them.

func Published

func Published(v bool) predicate.Post

Published applies equality check predicate on the "published" field. It's identical to PublishedEQ.

func PublishedEQ

func PublishedEQ(v bool) predicate.Post

PublishedEQ applies the EQ predicate on the "published" field.

func PublishedNEQ

func PublishedNEQ(v bool) predicate.Post

PublishedNEQ applies the NEQ predicate on the "published" field.

func Title

func Title(v string) predicate.Post

Title applies equality check predicate on the "title" field. It's identical to TitleEQ.

func TitleContains

func TitleContains(v string) predicate.Post

TitleContains applies the Contains predicate on the "title" field.

func TitleContainsFold

func TitleContainsFold(v string) predicate.Post

TitleContainsFold applies the ContainsFold predicate on the "title" field.

func TitleEQ

func TitleEQ(v string) predicate.Post

TitleEQ applies the EQ predicate on the "title" field.

func TitleEqualFold

func TitleEqualFold(v string) predicate.Post

TitleEqualFold applies the EqualFold predicate on the "title" field.

func TitleGT

func TitleGT(v string) predicate.Post

TitleGT applies the GT predicate on the "title" field.

func TitleGTE

func TitleGTE(v string) predicate.Post

TitleGTE applies the GTE predicate on the "title" field.

func TitleHasPrefix

func TitleHasPrefix(v string) predicate.Post

TitleHasPrefix applies the HasPrefix predicate on the "title" field.

func TitleHasSuffix

func TitleHasSuffix(v string) predicate.Post

TitleHasSuffix applies the HasSuffix predicate on the "title" field.

func TitleIn

func TitleIn(vs ...string) predicate.Post

TitleIn applies the In predicate on the "title" field.

func TitleLT

func TitleLT(v string) predicate.Post

TitleLT applies the LT predicate on the "title" field.

func TitleLTE

func TitleLTE(v string) predicate.Post

TitleLTE applies the LTE predicate on the "title" field.

func TitleNEQ

func TitleNEQ(v string) predicate.Post

TitleNEQ applies the NEQ predicate on the "title" field.

func TitleNotIn

func TitleNotIn(vs ...string) predicate.Post

TitleNotIn applies the NotIn predicate on the "title" field.

func ValidColumn

func ValidColumn(column string) bool

ValidColumn reports if the column name is valid (part of the table columns).

Types

type OrderOption

type OrderOption func(*sql.Selector)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL