answer

package
v0.0.0-...-4e78a55 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 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"
	// FieldCreatedAt holds the string denoting the created_at field in the database.
	FieldCreatedAt = "created_at"
	// 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

Columns holds all SQL columns for answer fields.

View Source
var (
	// DefaultCreatedAt holds the default value on creation for the "created_at" field.
	DefaultCreatedAt func() time.Time
)
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 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 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 ByQuestionField

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

ByQuestionField orders the results by question field.

Jump to

Keyboard shortcuts

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