post

package
v0.0.0-...-e71670f Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 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"
	// EdgeAuthor holds the string denoting the author edge name in mutations.
	EdgeAuthor = "author"
	// Table holds the table name of the post in the database.
	Table = "posts"
	// 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 = "user_posts"
)

Variables

View Source
var Columns = []string{
	FieldID,
}

Columns holds all SQL columns for post fields.

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 HasAuthor

func HasAuthor() predicate.Post

HasAuthor applies the HasEdge predicate on the "author" edge.

func HasAuthorWith

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

HasAuthorWith applies the HasEdge predicate on the "author" 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 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 ByAuthorField

func ByAuthorField(field string, opts ...sql.OrderTermOption) OrderOption

ByAuthorField orders the results by author field.

func ByID

func ByID(opts ...sql.OrderTermOption) OrderOption

ByID orders the results by the id field.

Jump to

Keyboard shortcuts

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