post

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2025 License: BSD-3-Clause Imports: 5 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"
	// FieldSubject holds the string denoting the subject field in the database.
	FieldSubject = "subject"
	// FieldBody holds the string denoting the body field in the database.
	FieldBody = "body"
	// 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"
	// 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 (
	// SubjectValidator is a validator for the "subject" field. It is called by the builders before save.
	SubjectValidator func(string) error
	// BodyValidator is a validator for the "body" field. It is called by the builders before save.
	BodyValidator func(string) error
	// 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
	// DefaultID holds the default value on creation for the "id" field.
	DefaultID func() uuid.UUID
)

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 Body

func Body(v string) predicate.Post

Body applies equality check predicate on the "body" field. It's identical to BodyEQ.

func BodyContains

func BodyContains(v string) predicate.Post

BodyContains applies the Contains predicate on the "body" field.

func BodyContainsFold

func BodyContainsFold(v string) predicate.Post

BodyContainsFold applies the ContainsFold predicate on the "body" field.

func BodyEQ

func BodyEQ(v string) predicate.Post

BodyEQ applies the EQ predicate on the "body" field.

func BodyEqualFold

func BodyEqualFold(v string) predicate.Post

BodyEqualFold applies the EqualFold predicate on the "body" field.

func BodyGT

func BodyGT(v string) predicate.Post

BodyGT applies the GT predicate on the "body" field.

func BodyGTE

func BodyGTE(v string) predicate.Post

BodyGTE applies the GTE predicate on the "body" field.

func BodyHasPrefix

func BodyHasPrefix(v string) predicate.Post

BodyHasPrefix applies the HasPrefix predicate on the "body" field.

func BodyHasSuffix

func BodyHasSuffix(v string) predicate.Post

BodyHasSuffix applies the HasSuffix predicate on the "body" field.

func BodyIn

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

BodyIn applies the In predicate on the "body" field.

func BodyLT

func BodyLT(v string) predicate.Post

BodyLT applies the LT predicate on the "body" field.

func BodyLTE

func BodyLTE(v string) predicate.Post

BodyLTE applies the LTE predicate on the "body" field.

func BodyNEQ

func BodyNEQ(v string) predicate.Post

BodyNEQ applies the NEQ predicate on the "body" field.

func BodyNotIn

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

BodyNotIn applies the NotIn predicate on the "body" field.

func CreatedAt

func CreatedAt(v time.Time) predicate.Post

CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.

func CreatedAtEQ

func CreatedAtEQ(v time.Time) predicate.Post

CreatedAtEQ applies the EQ predicate on the "created_at" field.

func CreatedAtGT

func CreatedAtGT(v time.Time) predicate.Post

CreatedAtGT applies the GT predicate on the "created_at" field.

func CreatedAtGTE

func CreatedAtGTE(v time.Time) predicate.Post

CreatedAtGTE applies the GTE predicate on the "created_at" field.

func CreatedAtIn

func CreatedAtIn(vs ...time.Time) predicate.Post

CreatedAtIn applies the In predicate on the "created_at" field.

func CreatedAtLT

func CreatedAtLT(v time.Time) predicate.Post

CreatedAtLT applies the LT predicate on the "created_at" field.

func CreatedAtLTE

func CreatedAtLTE(v time.Time) predicate.Post

CreatedAtLTE applies the LTE predicate on the "created_at" field.

func CreatedAtNEQ

func CreatedAtNEQ(v time.Time) predicate.Post

CreatedAtNEQ applies the NEQ predicate on the "created_at" field.

func CreatedAtNotIn

func CreatedAtNotIn(vs ...time.Time) predicate.Post

CreatedAtNotIn applies the NotIn predicate on the "created_at" field.

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 uuid.UUID) predicate.Post

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id uuid.UUID) predicate.Post

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id uuid.UUID) predicate.Post

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id uuid.UUID) predicate.Post

IDGTE applies the GTE predicate on the ID field.

func IDIn

func IDIn(ids ...uuid.UUID) predicate.Post

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id uuid.UUID) predicate.Post

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id uuid.UUID) predicate.Post

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id uuid.UUID) predicate.Post

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

func IDNotIn(ids ...uuid.UUID) 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 Subject

func Subject(v string) predicate.Post

Subject applies equality check predicate on the "subject" field. It's identical to SubjectEQ.

func SubjectContains

func SubjectContains(v string) predicate.Post

SubjectContains applies the Contains predicate on the "subject" field.

func SubjectContainsFold

func SubjectContainsFold(v string) predicate.Post

SubjectContainsFold applies the ContainsFold predicate on the "subject" field.

func SubjectEQ

func SubjectEQ(v string) predicate.Post

SubjectEQ applies the EQ predicate on the "subject" field.

func SubjectEqualFold

func SubjectEqualFold(v string) predicate.Post

SubjectEqualFold applies the EqualFold predicate on the "subject" field.

func SubjectGT

func SubjectGT(v string) predicate.Post

SubjectGT applies the GT predicate on the "subject" field.

func SubjectGTE

func SubjectGTE(v string) predicate.Post

SubjectGTE applies the GTE predicate on the "subject" field.

func SubjectHasPrefix

func SubjectHasPrefix(v string) predicate.Post

SubjectHasPrefix applies the HasPrefix predicate on the "subject" field.

func SubjectHasSuffix

func SubjectHasSuffix(v string) predicate.Post

SubjectHasSuffix applies the HasSuffix predicate on the "subject" field.

func SubjectIn

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

SubjectIn applies the In predicate on the "subject" field.

func SubjectLT

func SubjectLT(v string) predicate.Post

SubjectLT applies the LT predicate on the "subject" field.

func SubjectLTE

func SubjectLTE(v string) predicate.Post

SubjectLTE applies the LTE predicate on the "subject" field.

func SubjectNEQ

func SubjectNEQ(v string) predicate.Post

SubjectNEQ applies the NEQ predicate on the "subject" field.

func SubjectNotIn

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

SubjectNotIn applies the NotIn predicate on the "subject" field.

func UpdatedAt

func UpdatedAt(v time.Time) predicate.Post

UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.

func UpdatedAtEQ

func UpdatedAtEQ(v time.Time) predicate.Post

UpdatedAtEQ applies the EQ predicate on the "updated_at" field.

func UpdatedAtGT

func UpdatedAtGT(v time.Time) predicate.Post

UpdatedAtGT applies the GT predicate on the "updated_at" field.

func UpdatedAtGTE

func UpdatedAtGTE(v time.Time) predicate.Post

UpdatedAtGTE applies the GTE predicate on the "updated_at" field.

func UpdatedAtIn

func UpdatedAtIn(vs ...time.Time) predicate.Post

UpdatedAtIn applies the In predicate on the "updated_at" field.

func UpdatedAtLT

func UpdatedAtLT(v time.Time) predicate.Post

UpdatedAtLT applies the LT predicate on the "updated_at" field.

func UpdatedAtLTE

func UpdatedAtLTE(v time.Time) predicate.Post

UpdatedAtLTE applies the LTE predicate on the "updated_at" field.

func UpdatedAtNEQ

func UpdatedAtNEQ(v time.Time) predicate.Post

UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.

func UpdatedAtNotIn

func UpdatedAtNotIn(vs ...time.Time) predicate.Post

UpdatedAtNotIn applies the NotIn predicate on the "updated_at" 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 ByAuthorField

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

ByAuthorField orders the results by author field.

func ByBody

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

ByBody orders the results by the body field.

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 BySubject

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

BySubject orders the results by the subject field.

func ByUpdatedAt

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

ByUpdatedAt orders the results by the updated_at field.

Jump to

Keyboard shortcuts

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