Documentation ¶
Index ¶
- Constants
- Variables
- func And(predicates ...predicate.Sentence) predicate.Sentence
- func CreatedAt(v time.Time) predicate.Sentence
- func CreatedAtEQ(v time.Time) predicate.Sentence
- func CreatedAtGT(v time.Time) predicate.Sentence
- func CreatedAtGTE(v time.Time) predicate.Sentence
- func CreatedAtIn(vs ...time.Time) predicate.Sentence
- func CreatedAtLT(v time.Time) predicate.Sentence
- func CreatedAtLTE(v time.Time) predicate.Sentence
- func CreatedAtNEQ(v time.Time) predicate.Sentence
- func CreatedAtNotIn(vs ...time.Time) predicate.Sentence
- func HasAuthor() predicate.Sentence
- func HasAuthorWith(preds ...predicate.User) predicate.Sentence
- func HasStory() predicate.Sentence
- func HasStoryWith(preds ...predicate.Story) predicate.Sentence
- func ID(id uuid.UUID) predicate.Sentence
- func IDEQ(id uuid.UUID) predicate.Sentence
- func IDGT(id uuid.UUID) predicate.Sentence
- func IDGTE(id uuid.UUID) predicate.Sentence
- func IDIn(ids ...uuid.UUID) predicate.Sentence
- func IDLT(id uuid.UUID) predicate.Sentence
- func IDLTE(id uuid.UUID) predicate.Sentence
- func IDNEQ(id uuid.UUID) predicate.Sentence
- func IDNotIn(ids ...uuid.UUID) predicate.Sentence
- func Not(p predicate.Sentence) predicate.Sentence
- func Or(predicates ...predicate.Sentence) predicate.Sentence
- func Order(v int) predicate.Sentence
- func OrderEQ(v int) predicate.Sentence
- func OrderGT(v int) predicate.Sentence
- func OrderGTE(v int) predicate.Sentence
- func OrderIn(vs ...int) predicate.Sentence
- func OrderLT(v int) predicate.Sentence
- func OrderLTE(v int) predicate.Sentence
- func OrderNEQ(v int) predicate.Sentence
- func OrderNotIn(vs ...int) predicate.Sentence
- func Text(v string) predicate.Sentence
- func TextContains(v string) predicate.Sentence
- func TextContainsFold(v string) predicate.Sentence
- func TextEQ(v string) predicate.Sentence
- func TextEqualFold(v string) predicate.Sentence
- func TextGT(v string) predicate.Sentence
- func TextGTE(v string) predicate.Sentence
- func TextHasPrefix(v string) predicate.Sentence
- func TextHasSuffix(v string) predicate.Sentence
- func TextIn(vs ...string) predicate.Sentence
- func TextLT(v string) predicate.Sentence
- func TextLTE(v string) predicate.Sentence
- func TextNEQ(v string) predicate.Sentence
- func TextNotIn(vs ...string) predicate.Sentence
- func ValidColumn(column string) bool
- type OrderOption
- func ByAuthor(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption
- func ByAuthorCount(opts ...sql.OrderTermOption) OrderOption
- func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption
- func ByID(opts ...sql.OrderTermOption) OrderOption
- func ByOrder(opts ...sql.OrderTermOption) OrderOption
- func ByStoryField(field string, opts ...sql.OrderTermOption) OrderOption
- func ByText(opts ...sql.OrderTermOption) OrderOption
Constants ¶
const ( // Label holds the string label denoting the sentence type in the database. Label = "sentence" // FieldID holds the string denoting the id field in the database. FieldID = "id" // FieldText holds the string denoting the text field in the database. FieldText = "text" // FieldCreatedAt holds the string denoting the created_at field in the database. FieldCreatedAt = "created_at" // FieldOrder holds the string denoting the order field in the database. FieldOrder = "order" // EdgeStory holds the string denoting the story edge name in mutations. EdgeStory = "story" // EdgeAuthor holds the string denoting the author edge name in mutations. EdgeAuthor = "author" // Table holds the table name of the sentence in the database. Table = "sentences" // StoryTable is the table that holds the story relation/edge. StoryTable = "sentences" // StoryInverseTable is the table name for the Story entity. // It exists in this package in order to avoid circular dependency with the "story" package. StoryInverseTable = "stories" // StoryColumn is the table column denoting the story relation/edge. StoryColumn = "story_sentences" // AuthorTable is the table that holds the author relation/edge. The primary key declared below. AuthorTable = "user_sentences" // 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" )
Variables ¶
var ( // TextValidator is a validator for the "text" field. It is called by the builders before save. TextValidator func(string) error // DefaultCreatedAt holds the default value on creation for the "created_at" field. DefaultCreatedAt func() time.Time // OrderValidator is a validator for the "order" field. It is called by the builders before save. OrderValidator func(int) error // DefaultID holds the default value on creation for the "id" field. DefaultID func() uuid.UUID )
var ( // AuthorPrimaryKey and AuthorColumn2 are the table columns denoting the // primary key for the author relation (M2M). AuthorPrimaryKey = []string{"user_id", "sentence_id"} )
var Columns = []string{ FieldID, FieldText, FieldCreatedAt, FieldOrder, }
Columns holds all SQL columns for sentence fields.
var ForeignKeys = []string{
"story_sentences",
}
ForeignKeys holds the SQL foreign-keys that are owned by the "sentences" table and are not defined as standalone fields in the schema.
Functions ¶
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 HasAuthorWith ¶
HasAuthorWith applies the HasEdge predicate on the "author" edge with a given conditions (other predicates).
func HasStoryWith ¶
HasStoryWith applies the HasEdge predicate on the "story" edge with a given conditions (other predicates).
func Order ¶
Order applies equality check predicate on the "order" field. It's identical to OrderEQ.
func OrderNotIn ¶
OrderNotIn applies the NotIn predicate on the "order" field.
func TextContains ¶
TextContains applies the Contains predicate on the "text" field.
func TextContainsFold ¶
TextContainsFold applies the ContainsFold predicate on the "text" field.
func TextEqualFold ¶
TextEqualFold applies the EqualFold predicate on the "text" field.
func TextHasPrefix ¶
TextHasPrefix applies the HasPrefix predicate on the "text" field.
func TextHasSuffix ¶
TextHasSuffix applies the HasSuffix predicate on the "text" field.
func ValidColumn ¶
ValidColumn reports if the column name is valid (part of the table columns).
Types ¶
type OrderOption ¶
OrderOption defines the ordering options for the Sentence queries.
func ByAuthor ¶
func ByAuthor(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption
ByAuthor orders the results by author terms.
func ByAuthorCount ¶
func ByAuthorCount(opts ...sql.OrderTermOption) OrderOption
ByAuthorCount orders the results by author count.
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 ByOrder ¶
func ByOrder(opts ...sql.OrderTermOption) OrderOption
ByOrder orders the results by the order field.
func ByStoryField ¶
func ByStoryField(field string, opts ...sql.OrderTermOption) OrderOption
ByStoryField orders the results by story field.
func ByText ¶
func ByText(opts ...sql.OrderTermOption) OrderOption
ByText orders the results by the text field.