question

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 question type in the database.
	Label = "question"
	// 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"
	// FieldSlug holds the string denoting the slug field in the database.
	FieldSlug = "slug"
	// 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"
	// FieldUpdatedAt holds the string denoting the updated_at field in the database.
	FieldUpdatedAt = "updated_at"
	// FieldViews holds the string denoting the views field in the database.
	FieldViews = "views"
	// FieldLikes holds the string denoting the likes field in the database.
	FieldLikes = "likes"
	// EdgeAnswers holds the string denoting the answers edge name in mutations.
	EdgeAnswers = "answers"
	// EdgeAuthor holds the string denoting the author edge name in mutations.
	EdgeAuthor = "author"
	// EdgeTags holds the string denoting the tags edge name in mutations.
	EdgeTags = "tags"
	// Table holds the table name of the question in the database.
	Table = "questions"
	// AnswersTable is the table that holds the answers relation/edge.
	AnswersTable = "answers"
	// AnswersInverseTable is the table name for the Answer entity.
	// It exists in this package in order to avoid circular dependency with the "answer" package.
	AnswersInverseTable = "answers"
	// AnswersColumn is the table column denoting the answers relation/edge.
	AnswersColumn = "question_answers"
	// AuthorTable is the table that holds the author relation/edge.
	AuthorTable = "questions"
	// 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_questions"
	// TagsTable is the table that holds the tags relation/edge. The primary key declared below.
	TagsTable = "tag_questions"
	// TagsInverseTable is the table name for the Tag entity.
	// It exists in this package in order to avoid circular dependency with the "tag" package.
	TagsInverseTable = "tags"
)

Variables

View Source
var (
	// TitleValidator is a validator for the "title" field. It is called by the builders before save.
	TitleValidator 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
	// DefaultViews holds the default value on creation for the "views" field.
	DefaultViews int
	// DefaultLikes holds the default value on creation for the "likes" field.
	DefaultLikes int
)

Columns holds all SQL columns for question fields.

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

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

View Source
var (
	// TagsPrimaryKey and TagsColumn2 are the table columns denoting the
	// primary key for the tags relation (M2M).
	TagsPrimaryKey = []string{"tag_id", "question_id"}
)

Functions

func And

func And(predicates ...predicate.Question) predicate.Question

And groups predicates with the AND operator between them.

func Content

func Content(v string) predicate.Question

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

func ContentContains

func ContentContains(v string) predicate.Question

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

func ContentContainsFold

func ContentContainsFold(v string) predicate.Question

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

func ContentEQ

func ContentEQ(v string) predicate.Question

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

func ContentEqualFold

func ContentEqualFold(v string) predicate.Question

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

func ContentGT

func ContentGT(v string) predicate.Question

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

func ContentGTE

func ContentGTE(v string) predicate.Question

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

func ContentHasPrefix

func ContentHasPrefix(v string) predicate.Question

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

func ContentHasSuffix

func ContentHasSuffix(v string) predicate.Question

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

func ContentIn

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

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

func ContentLT

func ContentLT(v string) predicate.Question

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

func ContentLTE

func ContentLTE(v string) predicate.Question

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

func ContentNEQ

func ContentNEQ(v string) predicate.Question

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

func ContentNotIn

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

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

func CreatedAt

func CreatedAt(v time.Time) predicate.Question

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

func CreatedAtEQ

func CreatedAtEQ(v time.Time) predicate.Question

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

func CreatedAtGT

func CreatedAtGT(v time.Time) predicate.Question

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

func CreatedAtGTE

func CreatedAtGTE(v time.Time) predicate.Question

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

func CreatedAtIn

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

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

func CreatedAtLT

func CreatedAtLT(v time.Time) predicate.Question

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

func CreatedAtLTE

func CreatedAtLTE(v time.Time) predicate.Question

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

func CreatedAtNEQ

func CreatedAtNEQ(v time.Time) predicate.Question

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

func CreatedAtNotIn

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

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

func HasAnswers

func HasAnswers() predicate.Question

HasAnswers applies the HasEdge predicate on the "answers" edge.

func HasAnswersWith

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

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

func HasAuthor

func HasAuthor() predicate.Question

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

func HasAuthorWith

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

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

func HasTags

func HasTags() predicate.Question

HasTags applies the HasEdge predicate on the "tags" edge.

func HasTagsWith

func HasTagsWith(preds ...predicate.Tag) predicate.Question

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

func ID

func ID(id int) predicate.Question

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id int) predicate.Question

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id int) predicate.Question

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id int) predicate.Question

IDGTE applies the GTE predicate on the ID field.

func IDIn

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

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id int) predicate.Question

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id int) predicate.Question

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id int) predicate.Question

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

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

IDNotIn applies the NotIn predicate on the ID field.

func Likes

func Likes(v int) predicate.Question

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

func LikesEQ

func LikesEQ(v int) predicate.Question

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

func LikesGT

func LikesGT(v int) predicate.Question

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

func LikesGTE

func LikesGTE(v int) predicate.Question

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

func LikesIn

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

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

func LikesLT

func LikesLT(v int) predicate.Question

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

func LikesLTE

func LikesLTE(v int) predicate.Question

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

func LikesNEQ

func LikesNEQ(v int) predicate.Question

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

func LikesNotIn

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

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.Question) predicate.Question

Or groups predicates with the OR operator between them.

func Slug

func Slug(v string) predicate.Question

Slug applies equality check predicate on the "slug" field. It's identical to SlugEQ.

func SlugContains

func SlugContains(v string) predicate.Question

SlugContains applies the Contains predicate on the "slug" field.

func SlugContainsFold

func SlugContainsFold(v string) predicate.Question

SlugContainsFold applies the ContainsFold predicate on the "slug" field.

func SlugEQ

func SlugEQ(v string) predicate.Question

SlugEQ applies the EQ predicate on the "slug" field.

func SlugEqualFold

func SlugEqualFold(v string) predicate.Question

SlugEqualFold applies the EqualFold predicate on the "slug" field.

func SlugGT

func SlugGT(v string) predicate.Question

SlugGT applies the GT predicate on the "slug" field.

func SlugGTE

func SlugGTE(v string) predicate.Question

SlugGTE applies the GTE predicate on the "slug" field.

func SlugHasPrefix

func SlugHasPrefix(v string) predicate.Question

SlugHasPrefix applies the HasPrefix predicate on the "slug" field.

func SlugHasSuffix

func SlugHasSuffix(v string) predicate.Question

SlugHasSuffix applies the HasSuffix predicate on the "slug" field.

func SlugIn

func SlugIn(vs ...string) predicate.Question

SlugIn applies the In predicate on the "slug" field.

func SlugLT

func SlugLT(v string) predicate.Question

SlugLT applies the LT predicate on the "slug" field.

func SlugLTE

func SlugLTE(v string) predicate.Question

SlugLTE applies the LTE predicate on the "slug" field.

func SlugNEQ

func SlugNEQ(v string) predicate.Question

SlugNEQ applies the NEQ predicate on the "slug" field.

func SlugNotIn

func SlugNotIn(vs ...string) predicate.Question

SlugNotIn applies the NotIn predicate on the "slug" field.

func Title

func Title(v string) predicate.Question

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

func TitleContains

func TitleContains(v string) predicate.Question

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

func TitleContainsFold

func TitleContainsFold(v string) predicate.Question

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

func TitleEQ

func TitleEQ(v string) predicate.Question

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

func TitleEqualFold

func TitleEqualFold(v string) predicate.Question

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

func TitleGT

func TitleGT(v string) predicate.Question

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

func TitleGTE

func TitleGTE(v string) predicate.Question

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

func TitleHasPrefix

func TitleHasPrefix(v string) predicate.Question

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

func TitleHasSuffix

func TitleHasSuffix(v string) predicate.Question

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

func TitleIn

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

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

func TitleLT

func TitleLT(v string) predicate.Question

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

func TitleLTE

func TitleLTE(v string) predicate.Question

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

func TitleNEQ

func TitleNEQ(v string) predicate.Question

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

func TitleNotIn

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

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

func UpdatedAt

func UpdatedAt(v time.Time) predicate.Question

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

func UpdatedAtEQ

func UpdatedAtEQ(v time.Time) predicate.Question

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

func UpdatedAtGT

func UpdatedAtGT(v time.Time) predicate.Question

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

func UpdatedAtGTE

func UpdatedAtGTE(v time.Time) predicate.Question

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

func UpdatedAtIn

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

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

func UpdatedAtLT

func UpdatedAtLT(v time.Time) predicate.Question

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

func UpdatedAtLTE

func UpdatedAtLTE(v time.Time) predicate.Question

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

func UpdatedAtNEQ

func UpdatedAtNEQ(v time.Time) predicate.Question

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

func UpdatedAtNotIn

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

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).

func Views

func Views(v int) predicate.Question

Views applies equality check predicate on the "views" field. It's identical to ViewsEQ.

func ViewsEQ

func ViewsEQ(v int) predicate.Question

ViewsEQ applies the EQ predicate on the "views" field.

func ViewsGT

func ViewsGT(v int) predicate.Question

ViewsGT applies the GT predicate on the "views" field.

func ViewsGTE

func ViewsGTE(v int) predicate.Question

ViewsGTE applies the GTE predicate on the "views" field.

func ViewsIn

func ViewsIn(vs ...int) predicate.Question

ViewsIn applies the In predicate on the "views" field.

func ViewsLT

func ViewsLT(v int) predicate.Question

ViewsLT applies the LT predicate on the "views" field.

func ViewsLTE

func ViewsLTE(v int) predicate.Question

ViewsLTE applies the LTE predicate on the "views" field.

func ViewsNEQ

func ViewsNEQ(v int) predicate.Question

ViewsNEQ applies the NEQ predicate on the "views" field.

func ViewsNotIn

func ViewsNotIn(vs ...int) predicate.Question

ViewsNotIn applies the NotIn predicate on the "views" field.

Types

type OrderOption

type OrderOption func(*sql.Selector)

OrderOption defines the ordering options for the Question queries.

func ByAnswers

func ByAnswers(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption

ByAnswers orders the results by answers terms.

func ByAnswersCount

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

ByAnswersCount orders the results by answers count.

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 ByLikes

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

ByLikes orders the results by the likes field.

func BySlug

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

BySlug orders the results by the slug field.

func ByTags

func ByTags(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption

ByTags orders the results by tags terms.

func ByTagsCount

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

ByTagsCount orders the results by tags count.

func ByTitle

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

ByTitle orders the results by the title field.

func ByUpdatedAt

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

ByUpdatedAt orders the results by the updated_at field.

func ByViews

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

ByViews orders the results by the views field.

Jump to

Keyboard shortcuts

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