answer

package
v0.0.0-...-183bbd4 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label holds the string label denoting the answer type in the database.
	Label = "answer"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldContent holds the string denoting the content field in the database.
	FieldContent = "content"
	// FieldLikes holds the string denoting the likes field in the database.
	FieldLikes = "likes"
	// 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"
	// FieldIsAcceptedAnswer holds the string denoting the is_accepted_answer field in the database.
	FieldIsAcceptedAnswer = "is_accepted_answer"
	// EdgeQuestion holds the string denoting the question edge name in mutations.
	EdgeQuestion = "question"
	// EdgeAuthor holds the string denoting the author edge name in mutations.
	EdgeAuthor = "author"
	// Table holds the table name of the answer in the database.
	Table = "answers"
	// QuestionTable is the table that holds the question relation/edge.
	QuestionTable = "answers"
	// QuestionInverseTable is the table name for the Question entity.
	// It exists in this package in order to avoid circular dependency with the "question" package.
	QuestionInverseTable = "questions"
	// QuestionColumn is the table column denoting the question relation/edge.
	QuestionColumn = "question_answers"
	// AuthorTable is the table that holds the author relation/edge.
	AuthorTable = "answers"
	// 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_answers"
)

Variables

View Source
var (
	// DefaultLikes holds the default value on creation for the "likes" field.
	DefaultLikes int
	// 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
	// DefaultIsAcceptedAnswer holds the default value on creation for the "is_accepted_answer" field.
	DefaultIsAcceptedAnswer bool
)

Columns holds all SQL columns for answer fields.

View Source
var ForeignKeys = []string{
	"question_answers",
	"user_answers",
}

ForeignKeys holds the SQL foreign-keys that are owned by the "answers" table and are not defined as standalone fields in the schema.

Functions

func And

func And(predicates ...predicate.Answer) predicate.Answer

And groups predicates with the AND operator between them.

func Content

func Content(v string) predicate.Answer

Content applies equality check predicate on the "content" field. It's identical to ContentEQ.

func ContentContains

func ContentContains(v string) predicate.Answer

ContentContains applies the Contains predicate on the "content" field.

func ContentContainsFold

func ContentContainsFold(v string) predicate.Answer

ContentContainsFold applies the ContainsFold predicate on the "content" field.

func ContentEQ

func ContentEQ(v string) predicate.Answer

ContentEQ applies the EQ predicate on the "content" field.

func ContentEqualFold

func ContentEqualFold(v string) predicate.Answer

ContentEqualFold applies the EqualFold predicate on the "content" field.

func ContentGT

func ContentGT(v string) predicate.Answer

ContentGT applies the GT predicate on the "content" field.

func ContentGTE

func ContentGTE(v string) predicate.Answer

ContentGTE applies the GTE predicate on the "content" field.

func ContentHasPrefix

func ContentHasPrefix(v string) predicate.Answer

ContentHasPrefix applies the HasPrefix predicate on the "content" field.

func ContentHasSuffix

func ContentHasSuffix(v string) predicate.Answer

ContentHasSuffix applies the HasSuffix predicate on the "content" field.

func ContentIn

func ContentIn(vs ...string) predicate.Answer

ContentIn applies the In predicate on the "content" field.

func ContentLT

func ContentLT(v string) predicate.Answer

ContentLT applies the LT predicate on the "content" field.

func ContentLTE

func ContentLTE(v string) predicate.Answer

ContentLTE applies the LTE predicate on the "content" field.

func ContentNEQ

func ContentNEQ(v string) predicate.Answer

ContentNEQ applies the NEQ predicate on the "content" field.

func ContentNotIn

func ContentNotIn(vs ...string) predicate.Answer

ContentNotIn applies the NotIn predicate on the "content" field.

func CreatedAt

func CreatedAt(v time.Time) predicate.Answer

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

func CreatedAtEQ

func CreatedAtEQ(v time.Time) predicate.Answer

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

func CreatedAtGT

func CreatedAtGT(v time.Time) predicate.Answer

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

func CreatedAtGTE

func CreatedAtGTE(v time.Time) predicate.Answer

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

func CreatedAtIn

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

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

func CreatedAtLT

func CreatedAtLT(v time.Time) predicate.Answer

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

func CreatedAtLTE

func CreatedAtLTE(v time.Time) predicate.Answer

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

func CreatedAtNEQ

func CreatedAtNEQ(v time.Time) predicate.Answer

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

func CreatedAtNotIn

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

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

func HasAuthor

func HasAuthor() predicate.Answer

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

func HasAuthorWith

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

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

func HasQuestion

func HasQuestion() predicate.Answer

HasQuestion applies the HasEdge predicate on the "question" edge.

func HasQuestionWith

func HasQuestionWith(preds ...predicate.Question) predicate.Answer

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

func ID

func ID(id int) predicate.Answer

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id int) predicate.Answer

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id int) predicate.Answer

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id int) predicate.Answer

IDGTE applies the GTE predicate on the ID field.

func IDIn

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

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id int) predicate.Answer

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id int) predicate.Answer

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id int) predicate.Answer

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

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

IDNotIn applies the NotIn predicate on the ID field.

func IsAcceptedAnswer

func IsAcceptedAnswer(v bool) predicate.Answer

IsAcceptedAnswer applies equality check predicate on the "is_accepted_answer" field. It's identical to IsAcceptedAnswerEQ.

func IsAcceptedAnswerEQ

func IsAcceptedAnswerEQ(v bool) predicate.Answer

IsAcceptedAnswerEQ applies the EQ predicate on the "is_accepted_answer" field.

func IsAcceptedAnswerNEQ

func IsAcceptedAnswerNEQ(v bool) predicate.Answer

IsAcceptedAnswerNEQ applies the NEQ predicate on the "is_accepted_answer" field.

func Likes

func Likes(v int) predicate.Answer

Likes applies equality check predicate on the "likes" field. It's identical to LikesEQ.

func LikesEQ

func LikesEQ(v int) predicate.Answer

LikesEQ applies the EQ predicate on the "likes" field.

func LikesGT

func LikesGT(v int) predicate.Answer

LikesGT applies the GT predicate on the "likes" field.

func LikesGTE

func LikesGTE(v int) predicate.Answer

LikesGTE applies the GTE predicate on the "likes" field.

func LikesIn

func LikesIn(vs ...int) predicate.Answer

LikesIn applies the In predicate on the "likes" field.

func LikesLT

func LikesLT(v int) predicate.Answer

LikesLT applies the LT predicate on the "likes" field.

func LikesLTE

func LikesLTE(v int) predicate.Answer

LikesLTE applies the LTE predicate on the "likes" field.

func LikesNEQ

func LikesNEQ(v int) predicate.Answer

LikesNEQ applies the NEQ predicate on the "likes" field.

func LikesNotIn

func LikesNotIn(vs ...int) predicate.Answer

LikesNotIn applies the NotIn predicate on the "likes" field.

func Not

Not applies the not operator on the given predicate.

func Or

func Or(predicates ...predicate.Answer) predicate.Answer

Or groups predicates with the OR operator between them.

func UpdatedAt

func UpdatedAt(v time.Time) predicate.Answer

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

func UpdatedAtEQ

func UpdatedAtEQ(v time.Time) predicate.Answer

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

func UpdatedAtGT

func UpdatedAtGT(v time.Time) predicate.Answer

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

func UpdatedAtGTE

func UpdatedAtGTE(v time.Time) predicate.Answer

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

func UpdatedAtIn

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

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

func UpdatedAtLT

func UpdatedAtLT(v time.Time) predicate.Answer

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

func UpdatedAtLTE

func UpdatedAtLTE(v time.Time) predicate.Answer

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

func UpdatedAtNEQ

func UpdatedAtNEQ(v time.Time) predicate.Answer

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

func UpdatedAtNotIn

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

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 Answer queries.

func ByAuthorField

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

ByAuthorField orders the results by author field.

func ByContent

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

ByContent orders the results by the content 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 ByIsAcceptedAnswer

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

ByIsAcceptedAnswer orders the results by the is_accepted_answer field.

func ByLikes

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

ByLikes orders the results by the likes field.

func ByQuestionField

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

ByQuestionField orders the results by question 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