Documentation
¶
Index ¶
- Constants
- Variables
- func And(predicates ...predicate.Question) predicate.Question
- func Content(v string) predicate.Question
- func ContentContains(v string) predicate.Question
- func ContentContainsFold(v string) predicate.Question
- func ContentEQ(v string) predicate.Question
- func ContentEqualFold(v string) predicate.Question
- func ContentGT(v string) predicate.Question
- func ContentGTE(v string) predicate.Question
- func ContentHasPrefix(v string) predicate.Question
- func ContentHasSuffix(v string) predicate.Question
- func ContentIn(vs ...string) predicate.Question
- func ContentLT(v string) predicate.Question
- func ContentLTE(v string) predicate.Question
- func ContentNEQ(v string) predicate.Question
- func ContentNotIn(vs ...string) predicate.Question
- func CreatedAt(v time.Time) predicate.Question
- func CreatedAtEQ(v time.Time) predicate.Question
- func CreatedAtGT(v time.Time) predicate.Question
- func CreatedAtGTE(v time.Time) predicate.Question
- func CreatedAtIn(vs ...time.Time) predicate.Question
- func CreatedAtLT(v time.Time) predicate.Question
- func CreatedAtLTE(v time.Time) predicate.Question
- func CreatedAtNEQ(v time.Time) predicate.Question
- func CreatedAtNotIn(vs ...time.Time) predicate.Question
- func HasAnswers() predicate.Question
- func HasAnswersWith(preds ...predicate.Answer) predicate.Question
- func HasAuthor() predicate.Question
- func HasAuthorWith(preds ...predicate.User) predicate.Question
- func HasTags() predicate.Question
- func HasTagsWith(preds ...predicate.Tag) predicate.Question
- func ID(id int) predicate.Question
- func IDEQ(id int) predicate.Question
- func IDGT(id int) predicate.Question
- func IDGTE(id int) predicate.Question
- func IDIn(ids ...int) predicate.Question
- func IDLT(id int) predicate.Question
- func IDLTE(id int) predicate.Question
- func IDNEQ(id int) predicate.Question
- func IDNotIn(ids ...int) predicate.Question
- func Likes(v int) predicate.Question
- func LikesEQ(v int) predicate.Question
- func LikesGT(v int) predicate.Question
- func LikesGTE(v int) predicate.Question
- func LikesIn(vs ...int) predicate.Question
- func LikesLT(v int) predicate.Question
- func LikesLTE(v int) predicate.Question
- func LikesNEQ(v int) predicate.Question
- func LikesNotIn(vs ...int) predicate.Question
- func Not(p predicate.Question) predicate.Question
- func Or(predicates ...predicate.Question) predicate.Question
- func Slug(v string) predicate.Question
- func SlugContains(v string) predicate.Question
- func SlugContainsFold(v string) predicate.Question
- func SlugEQ(v string) predicate.Question
- func SlugEqualFold(v string) predicate.Question
- func SlugGT(v string) predicate.Question
- func SlugGTE(v string) predicate.Question
- func SlugHasPrefix(v string) predicate.Question
- func SlugHasSuffix(v string) predicate.Question
- func SlugIn(vs ...string) predicate.Question
- func SlugLT(v string) predicate.Question
- func SlugLTE(v string) predicate.Question
- func SlugNEQ(v string) predicate.Question
- func SlugNotIn(vs ...string) predicate.Question
- func Title(v string) predicate.Question
- func TitleContains(v string) predicate.Question
- func TitleContainsFold(v string) predicate.Question
- func TitleEQ(v string) predicate.Question
- func TitleEqualFold(v string) predicate.Question
- func TitleGT(v string) predicate.Question
- func TitleGTE(v string) predicate.Question
- func TitleHasPrefix(v string) predicate.Question
- func TitleHasSuffix(v string) predicate.Question
- func TitleIn(vs ...string) predicate.Question
- func TitleLT(v string) predicate.Question
- func TitleLTE(v string) predicate.Question
- func TitleNEQ(v string) predicate.Question
- func TitleNotIn(vs ...string) predicate.Question
- func UpdatedAt(v time.Time) predicate.Question
- func UpdatedAtEQ(v time.Time) predicate.Question
- func UpdatedAtGT(v time.Time) predicate.Question
- func UpdatedAtGTE(v time.Time) predicate.Question
- func UpdatedAtIn(vs ...time.Time) predicate.Question
- func UpdatedAtLT(v time.Time) predicate.Question
- func UpdatedAtLTE(v time.Time) predicate.Question
- func UpdatedAtNEQ(v time.Time) predicate.Question
- func UpdatedAtNotIn(vs ...time.Time) predicate.Question
- func ValidColumn(column string) bool
- func Views(v int) predicate.Question
- func ViewsEQ(v int) predicate.Question
- func ViewsGT(v int) predicate.Question
- func ViewsGTE(v int) predicate.Question
- func ViewsIn(vs ...int) predicate.Question
- func ViewsLT(v int) predicate.Question
- func ViewsLTE(v int) predicate.Question
- func ViewsNEQ(v int) predicate.Question
- func ViewsNotIn(vs ...int) predicate.Question
- type OrderOption
- func ByAnswers(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption
- func ByAnswersCount(opts ...sql.OrderTermOption) OrderOption
- func ByAuthorField(field string, opts ...sql.OrderTermOption) OrderOption
- func ByContent(opts ...sql.OrderTermOption) OrderOption
- func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption
- func ByID(opts ...sql.OrderTermOption) OrderOption
- func ByLikes(opts ...sql.OrderTermOption) OrderOption
- func BySlug(opts ...sql.OrderTermOption) OrderOption
- func ByTags(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption
- func ByTagsCount(opts ...sql.OrderTermOption) OrderOption
- func ByTitle(opts ...sql.OrderTermOption) OrderOption
- func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption
- func ByViews(opts ...sql.OrderTermOption) OrderOption
Constants ¶
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 ¶
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 )
var Columns = []string{ FieldID, FieldTitle, FieldSlug, FieldContent, FieldCreatedAt, FieldUpdatedAt, FieldViews, FieldLikes, }
Columns holds all SQL columns for question fields.
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.
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 Content ¶
Content applies equality check predicate on the "content" field. It's identical to ContentEQ.
func ContentContains ¶
ContentContains applies the Contains predicate on the "content" field.
func ContentContainsFold ¶
ContentContainsFold applies the ContainsFold predicate on the "content" field.
func ContentEqualFold ¶
ContentEqualFold applies the EqualFold predicate on the "content" field.
func ContentGTE ¶
ContentGTE applies the GTE predicate on the "content" field.
func ContentHasPrefix ¶
ContentHasPrefix applies the HasPrefix predicate on the "content" field.
func ContentHasSuffix ¶
ContentHasSuffix applies the HasSuffix predicate on the "content" field.
func ContentLTE ¶
ContentLTE applies the LTE predicate on the "content" field.
func ContentNEQ ¶
ContentNEQ applies the NEQ predicate on the "content" field.
func ContentNotIn ¶
ContentNotIn applies the NotIn predicate on the "content" field.
func CreatedAt ¶
CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
func CreatedAtEQ ¶
CreatedAtEQ applies the EQ predicate on the "created_at" field.
func CreatedAtGT ¶
CreatedAtGT applies the GT predicate on the "created_at" field.
func CreatedAtGTE ¶
CreatedAtGTE applies the GTE predicate on the "created_at" field.
func CreatedAtIn ¶
CreatedAtIn applies the In predicate on the "created_at" field.
func CreatedAtLT ¶
CreatedAtLT applies the LT predicate on the "created_at" field.
func CreatedAtLTE ¶
CreatedAtLTE applies the LTE predicate on the "created_at" field.
func CreatedAtNEQ ¶
CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
func CreatedAtNotIn ¶
CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
func HasAnswers ¶
HasAnswers applies the HasEdge predicate on the "answers" edge.
func HasAnswersWith ¶
HasAnswersWith applies the HasEdge predicate on the "answers" edge with a given conditions (other predicates).
func HasAuthorWith ¶
HasAuthorWith applies the HasEdge predicate on the "author" edge with a given conditions (other predicates).
func HasTagsWith ¶
HasTagsWith applies the HasEdge predicate on the "tags" edge with a given conditions (other predicates).
func Likes ¶
Likes applies equality check predicate on the "likes" field. It's identical to LikesEQ.
func LikesNotIn ¶
LikesNotIn applies the NotIn predicate on the "likes" field.
func SlugContains ¶
SlugContains applies the Contains predicate on the "slug" field.
func SlugContainsFold ¶
SlugContainsFold applies the ContainsFold predicate on the "slug" field.
func SlugEqualFold ¶
SlugEqualFold applies the EqualFold predicate on the "slug" field.
func SlugHasPrefix ¶
SlugHasPrefix applies the HasPrefix predicate on the "slug" field.
func SlugHasSuffix ¶
SlugHasSuffix applies the HasSuffix predicate on the "slug" field.
func Title ¶
Title applies equality check predicate on the "title" field. It's identical to TitleEQ.
func TitleContains ¶
TitleContains applies the Contains predicate on the "title" field.
func TitleContainsFold ¶
TitleContainsFold applies the ContainsFold predicate on the "title" field.
func TitleEqualFold ¶
TitleEqualFold applies the EqualFold predicate on the "title" field.
func TitleHasPrefix ¶
TitleHasPrefix applies the HasPrefix predicate on the "title" field.
func TitleHasSuffix ¶
TitleHasSuffix applies the HasSuffix predicate on the "title" field.
func TitleNotIn ¶
TitleNotIn applies the NotIn predicate on the "title" field.
func UpdatedAt ¶
UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.
func UpdatedAtEQ ¶
UpdatedAtEQ applies the EQ predicate on the "updated_at" field.
func UpdatedAtGT ¶
UpdatedAtGT applies the GT predicate on the "updated_at" field.
func UpdatedAtGTE ¶
UpdatedAtGTE applies the GTE predicate on the "updated_at" field.
func UpdatedAtIn ¶
UpdatedAtIn applies the In predicate on the "updated_at" field.
func UpdatedAtLT ¶
UpdatedAtLT applies the LT predicate on the "updated_at" field.
func UpdatedAtLTE ¶
UpdatedAtLTE applies the LTE predicate on the "updated_at" field.
func UpdatedAtNEQ ¶
UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.
func UpdatedAtNotIn ¶
UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.
func ValidColumn ¶
ValidColumn reports if the column name is valid (part of the table columns).
func Views ¶
Views applies equality check predicate on the "views" field. It's identical to ViewsEQ.
func ViewsNotIn ¶
ViewsNotIn applies the NotIn predicate on the "views" field.
Types ¶
type OrderOption ¶
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.