mirror of
https://github.com/versia-pub/versia-go.git
synced 2026-03-13 04:29:15 +01:00
chore: init
This commit is contained in:
commit
320715f3e7
174 changed files with 42083 additions and 0 deletions
257
ent/note/note.go
Normal file
257
ent/note/note.go
Normal file
|
|
@ -0,0 +1,257 @@
|
|||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package note
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
"github.com/google/uuid"
|
||||
"github.com/lysand-org/versia-go/pkg/lysand"
|
||||
)
|
||||
|
||||
const (
|
||||
// Label holds the string label denoting the note type in the database.
|
||||
Label = "note"
|
||||
// FieldID holds the string denoting the id field in the database.
|
||||
FieldID = "id"
|
||||
// FieldIsRemote holds the string denoting the isremote field in the database.
|
||||
FieldIsRemote = "is_remote"
|
||||
// FieldURI holds the string denoting the uri field in the database.
|
||||
FieldURI = "uri"
|
||||
// FieldExtensions holds the string denoting the extensions field in the database.
|
||||
FieldExtensions = "extensions"
|
||||
// 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"
|
||||
// FieldSubject holds the string denoting the subject field in the database.
|
||||
FieldSubject = "subject"
|
||||
// FieldContent holds the string denoting the content field in the database.
|
||||
FieldContent = "content"
|
||||
// FieldIsSensitive holds the string denoting the issensitive field in the database.
|
||||
FieldIsSensitive = "is_sensitive"
|
||||
// FieldVisibility holds the string denoting the visibility field in the database.
|
||||
FieldVisibility = "visibility"
|
||||
// EdgeAuthor holds the string denoting the author edge name in mutations.
|
||||
EdgeAuthor = "author"
|
||||
// EdgeMentions holds the string denoting the mentions edge name in mutations.
|
||||
EdgeMentions = "mentions"
|
||||
// EdgeAttachments holds the string denoting the attachments edge name in mutations.
|
||||
EdgeAttachments = "attachments"
|
||||
// Table holds the table name of the note in the database.
|
||||
Table = "notes"
|
||||
// AuthorTable is the table that holds the author relation/edge.
|
||||
AuthorTable = "notes"
|
||||
// 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 = "note_author"
|
||||
// MentionsTable is the table that holds the mentions relation/edge. The primary key declared below.
|
||||
MentionsTable = "note_mentions"
|
||||
// MentionsInverseTable is the table name for the User entity.
|
||||
// It exists in this package in order to avoid circular dependency with the "user" package.
|
||||
MentionsInverseTable = "users"
|
||||
// AttachmentsTable is the table that holds the attachments relation/edge.
|
||||
AttachmentsTable = "attachments"
|
||||
// AttachmentsInverseTable is the table name for the Attachment entity.
|
||||
// It exists in this package in order to avoid circular dependency with the "attachment" package.
|
||||
AttachmentsInverseTable = "attachments"
|
||||
// AttachmentsColumn is the table column denoting the attachments relation/edge.
|
||||
AttachmentsColumn = "note_attachments"
|
||||
)
|
||||
|
||||
// Columns holds all SQL columns for note fields.
|
||||
var Columns = []string{
|
||||
FieldID,
|
||||
FieldIsRemote,
|
||||
FieldURI,
|
||||
FieldExtensions,
|
||||
FieldCreatedAt,
|
||||
FieldUpdatedAt,
|
||||
FieldSubject,
|
||||
FieldContent,
|
||||
FieldIsSensitive,
|
||||
FieldVisibility,
|
||||
}
|
||||
|
||||
// ForeignKeys holds the SQL foreign-keys that are owned by the "notes"
|
||||
// table and are not defined as standalone fields in the schema.
|
||||
var ForeignKeys = []string{
|
||||
"note_author",
|
||||
}
|
||||
|
||||
var (
|
||||
// MentionsPrimaryKey and MentionsColumn2 are the table columns denoting the
|
||||
// primary key for the mentions relation (M2M).
|
||||
MentionsPrimaryKey = []string{"note_id", "user_id"}
|
||||
)
|
||||
|
||||
// ValidColumn reports if the column name is valid (part of the table columns).
|
||||
func ValidColumn(column string) bool {
|
||||
for i := range Columns {
|
||||
if column == Columns[i] {
|
||||
return true
|
||||
}
|
||||
}
|
||||
for i := range ForeignKeys {
|
||||
if column == ForeignKeys[i] {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var (
|
||||
// URIValidator is a validator for the "uri" field. It is called by the builders before save.
|
||||
URIValidator func(string) error
|
||||
// DefaultExtensions holds the default value on creation for the "extensions" field.
|
||||
DefaultExtensions lysand.Extensions
|
||||
// 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
|
||||
// SubjectValidator is a validator for the "subject" field. It is called by the builders before save.
|
||||
SubjectValidator func(string) error
|
||||
// DefaultIsSensitive holds the default value on creation for the "isSensitive" field.
|
||||
DefaultIsSensitive bool
|
||||
// DefaultID holds the default value on creation for the "id" field.
|
||||
DefaultID func() uuid.UUID
|
||||
)
|
||||
|
||||
// Visibility defines the type for the "visibility" enum field.
|
||||
type Visibility string
|
||||
|
||||
// VisibilityPublic is the default value of the Visibility enum.
|
||||
const DefaultVisibility = VisibilityPublic
|
||||
|
||||
// Visibility values.
|
||||
const (
|
||||
VisibilityPublic Visibility = "public"
|
||||
VisibilityUnlisted Visibility = "unlisted"
|
||||
VisibilityFollowers Visibility = "followers"
|
||||
VisibilityDirect Visibility = "direct"
|
||||
)
|
||||
|
||||
func (v Visibility) String() string {
|
||||
return string(v)
|
||||
}
|
||||
|
||||
// VisibilityValidator is a validator for the "visibility" field enum values. It is called by the builders before save.
|
||||
func VisibilityValidator(v Visibility) error {
|
||||
switch v {
|
||||
case VisibilityPublic, VisibilityUnlisted, VisibilityFollowers, VisibilityDirect:
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("note: invalid enum value for visibility field: %q", v)
|
||||
}
|
||||
}
|
||||
|
||||
// OrderOption defines the ordering options for the Note queries.
|
||||
type OrderOption func(*sql.Selector)
|
||||
|
||||
// ByID orders the results by the id field.
|
||||
func ByID(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldID, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByIsRemote orders the results by the isRemote field.
|
||||
func ByIsRemote(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldIsRemote, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByURI orders the results by the uri field.
|
||||
func ByURI(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldURI, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByCreatedAt orders the results by the created_at field.
|
||||
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByUpdatedAt orders the results by the updated_at field.
|
||||
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// BySubject orders the results by the subject field.
|
||||
func BySubject(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldSubject, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByContent orders the results by the content field.
|
||||
func ByContent(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldContent, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByIsSensitive orders the results by the isSensitive field.
|
||||
func ByIsSensitive(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldIsSensitive, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByVisibility orders the results by the visibility field.
|
||||
func ByVisibility(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldVisibility, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByAuthorField orders the results by author field.
|
||||
func ByAuthorField(field string, opts ...sql.OrderTermOption) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborTerms(s, newAuthorStep(), sql.OrderByField(field, opts...))
|
||||
}
|
||||
}
|
||||
|
||||
// ByMentionsCount orders the results by mentions count.
|
||||
func ByMentionsCount(opts ...sql.OrderTermOption) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborsCount(s, newMentionsStep(), opts...)
|
||||
}
|
||||
}
|
||||
|
||||
// ByMentions orders the results by mentions terms.
|
||||
func ByMentions(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborTerms(s, newMentionsStep(), append([]sql.OrderTerm{term}, terms...)...)
|
||||
}
|
||||
}
|
||||
|
||||
// ByAttachmentsCount orders the results by attachments count.
|
||||
func ByAttachmentsCount(opts ...sql.OrderTermOption) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborsCount(s, newAttachmentsStep(), opts...)
|
||||
}
|
||||
}
|
||||
|
||||
// ByAttachments orders the results by attachments terms.
|
||||
func ByAttachments(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborTerms(s, newAttachmentsStep(), append([]sql.OrderTerm{term}, terms...)...)
|
||||
}
|
||||
}
|
||||
func newAuthorStep() *sqlgraph.Step {
|
||||
return sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(AuthorInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, false, AuthorTable, AuthorColumn),
|
||||
)
|
||||
}
|
||||
func newMentionsStep() *sqlgraph.Step {
|
||||
return sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(MentionsInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2M, false, MentionsTable, MentionsPrimaryKey...),
|
||||
)
|
||||
}
|
||||
func newAttachmentsStep() *sqlgraph.Step {
|
||||
return sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(AttachmentsInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.O2M, false, AttachmentsTable, AttachmentsColumn),
|
||||
)
|
||||
}
|
||||
501
ent/note/where.go
Normal file
501
ent/note/where.go
Normal file
|
|
@ -0,0 +1,501 @@
|
|||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package note
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
"github.com/google/uuid"
|
||||
"github.com/lysand-org/versia-go/ent/predicate"
|
||||
)
|
||||
|
||||
// ID filters vertices based on their ID field.
|
||||
func ID(id uuid.UUID) predicate.Note {
|
||||
return predicate.Note(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDEQ applies the EQ predicate on the ID field.
|
||||
func IDEQ(id uuid.UUID) predicate.Note {
|
||||
return predicate.Note(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDNEQ applies the NEQ predicate on the ID field.
|
||||
func IDNEQ(id uuid.UUID) predicate.Note {
|
||||
return predicate.Note(sql.FieldNEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDIn applies the In predicate on the ID field.
|
||||
func IDIn(ids ...uuid.UUID) predicate.Note {
|
||||
return predicate.Note(sql.FieldIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDNotIn applies the NotIn predicate on the ID field.
|
||||
func IDNotIn(ids ...uuid.UUID) predicate.Note {
|
||||
return predicate.Note(sql.FieldNotIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDGT applies the GT predicate on the ID field.
|
||||
func IDGT(id uuid.UUID) predicate.Note {
|
||||
return predicate.Note(sql.FieldGT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDGTE applies the GTE predicate on the ID field.
|
||||
func IDGTE(id uuid.UUID) predicate.Note {
|
||||
return predicate.Note(sql.FieldGTE(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLT applies the LT predicate on the ID field.
|
||||
func IDLT(id uuid.UUID) predicate.Note {
|
||||
return predicate.Note(sql.FieldLT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLTE applies the LTE predicate on the ID field.
|
||||
func IDLTE(id uuid.UUID) predicate.Note {
|
||||
return predicate.Note(sql.FieldLTE(FieldID, id))
|
||||
}
|
||||
|
||||
// IsRemote applies equality check predicate on the "isRemote" field. It's identical to IsRemoteEQ.
|
||||
func IsRemote(v bool) predicate.Note {
|
||||
return predicate.Note(sql.FieldEQ(FieldIsRemote, v))
|
||||
}
|
||||
|
||||
// URI applies equality check predicate on the "uri" field. It's identical to URIEQ.
|
||||
func URI(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldEQ(FieldURI, v))
|
||||
}
|
||||
|
||||
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
|
||||
func CreatedAt(v time.Time) predicate.Note {
|
||||
return predicate.Note(sql.FieldEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.
|
||||
func UpdatedAt(v time.Time) predicate.Note {
|
||||
return predicate.Note(sql.FieldEQ(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// Subject applies equality check predicate on the "subject" field. It's identical to SubjectEQ.
|
||||
func Subject(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldEQ(FieldSubject, v))
|
||||
}
|
||||
|
||||
// Content applies equality check predicate on the "content" field. It's identical to ContentEQ.
|
||||
func Content(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldEQ(FieldContent, v))
|
||||
}
|
||||
|
||||
// IsSensitive applies equality check predicate on the "isSensitive" field. It's identical to IsSensitiveEQ.
|
||||
func IsSensitive(v bool) predicate.Note {
|
||||
return predicate.Note(sql.FieldEQ(FieldIsSensitive, v))
|
||||
}
|
||||
|
||||
// IsRemoteEQ applies the EQ predicate on the "isRemote" field.
|
||||
func IsRemoteEQ(v bool) predicate.Note {
|
||||
return predicate.Note(sql.FieldEQ(FieldIsRemote, v))
|
||||
}
|
||||
|
||||
// IsRemoteNEQ applies the NEQ predicate on the "isRemote" field.
|
||||
func IsRemoteNEQ(v bool) predicate.Note {
|
||||
return predicate.Note(sql.FieldNEQ(FieldIsRemote, v))
|
||||
}
|
||||
|
||||
// URIEQ applies the EQ predicate on the "uri" field.
|
||||
func URIEQ(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldEQ(FieldURI, v))
|
||||
}
|
||||
|
||||
// URINEQ applies the NEQ predicate on the "uri" field.
|
||||
func URINEQ(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldNEQ(FieldURI, v))
|
||||
}
|
||||
|
||||
// URIIn applies the In predicate on the "uri" field.
|
||||
func URIIn(vs ...string) predicate.Note {
|
||||
return predicate.Note(sql.FieldIn(FieldURI, vs...))
|
||||
}
|
||||
|
||||
// URINotIn applies the NotIn predicate on the "uri" field.
|
||||
func URINotIn(vs ...string) predicate.Note {
|
||||
return predicate.Note(sql.FieldNotIn(FieldURI, vs...))
|
||||
}
|
||||
|
||||
// URIGT applies the GT predicate on the "uri" field.
|
||||
func URIGT(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldGT(FieldURI, v))
|
||||
}
|
||||
|
||||
// URIGTE applies the GTE predicate on the "uri" field.
|
||||
func URIGTE(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldGTE(FieldURI, v))
|
||||
}
|
||||
|
||||
// URILT applies the LT predicate on the "uri" field.
|
||||
func URILT(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldLT(FieldURI, v))
|
||||
}
|
||||
|
||||
// URILTE applies the LTE predicate on the "uri" field.
|
||||
func URILTE(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldLTE(FieldURI, v))
|
||||
}
|
||||
|
||||
// URIContains applies the Contains predicate on the "uri" field.
|
||||
func URIContains(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldContains(FieldURI, v))
|
||||
}
|
||||
|
||||
// URIHasPrefix applies the HasPrefix predicate on the "uri" field.
|
||||
func URIHasPrefix(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldHasPrefix(FieldURI, v))
|
||||
}
|
||||
|
||||
// URIHasSuffix applies the HasSuffix predicate on the "uri" field.
|
||||
func URIHasSuffix(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldHasSuffix(FieldURI, v))
|
||||
}
|
||||
|
||||
// URIEqualFold applies the EqualFold predicate on the "uri" field.
|
||||
func URIEqualFold(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldEqualFold(FieldURI, v))
|
||||
}
|
||||
|
||||
// URIContainsFold applies the ContainsFold predicate on the "uri" field.
|
||||
func URIContainsFold(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldContainsFold(FieldURI, v))
|
||||
}
|
||||
|
||||
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
|
||||
func CreatedAtEQ(v time.Time) predicate.Note {
|
||||
return predicate.Note(sql.FieldEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
|
||||
func CreatedAtNEQ(v time.Time) predicate.Note {
|
||||
return predicate.Note(sql.FieldNEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtIn applies the In predicate on the "created_at" field.
|
||||
func CreatedAtIn(vs ...time.Time) predicate.Note {
|
||||
return predicate.Note(sql.FieldIn(FieldCreatedAt, vs...))
|
||||
}
|
||||
|
||||
// CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
|
||||
func CreatedAtNotIn(vs ...time.Time) predicate.Note {
|
||||
return predicate.Note(sql.FieldNotIn(FieldCreatedAt, vs...))
|
||||
}
|
||||
|
||||
// CreatedAtGT applies the GT predicate on the "created_at" field.
|
||||
func CreatedAtGT(v time.Time) predicate.Note {
|
||||
return predicate.Note(sql.FieldGT(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtGTE applies the GTE predicate on the "created_at" field.
|
||||
func CreatedAtGTE(v time.Time) predicate.Note {
|
||||
return predicate.Note(sql.FieldGTE(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtLT applies the LT predicate on the "created_at" field.
|
||||
func CreatedAtLT(v time.Time) predicate.Note {
|
||||
return predicate.Note(sql.FieldLT(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtLTE applies the LTE predicate on the "created_at" field.
|
||||
func CreatedAtLTE(v time.Time) predicate.Note {
|
||||
return predicate.Note(sql.FieldLTE(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtEQ applies the EQ predicate on the "updated_at" field.
|
||||
func UpdatedAtEQ(v time.Time) predicate.Note {
|
||||
return predicate.Note(sql.FieldEQ(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.
|
||||
func UpdatedAtNEQ(v time.Time) predicate.Note {
|
||||
return predicate.Note(sql.FieldNEQ(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtIn applies the In predicate on the "updated_at" field.
|
||||
func UpdatedAtIn(vs ...time.Time) predicate.Note {
|
||||
return predicate.Note(sql.FieldIn(FieldUpdatedAt, vs...))
|
||||
}
|
||||
|
||||
// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.
|
||||
func UpdatedAtNotIn(vs ...time.Time) predicate.Note {
|
||||
return predicate.Note(sql.FieldNotIn(FieldUpdatedAt, vs...))
|
||||
}
|
||||
|
||||
// UpdatedAtGT applies the GT predicate on the "updated_at" field.
|
||||
func UpdatedAtGT(v time.Time) predicate.Note {
|
||||
return predicate.Note(sql.FieldGT(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtGTE applies the GTE predicate on the "updated_at" field.
|
||||
func UpdatedAtGTE(v time.Time) predicate.Note {
|
||||
return predicate.Note(sql.FieldGTE(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtLT applies the LT predicate on the "updated_at" field.
|
||||
func UpdatedAtLT(v time.Time) predicate.Note {
|
||||
return predicate.Note(sql.FieldLT(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtLTE applies the LTE predicate on the "updated_at" field.
|
||||
func UpdatedAtLTE(v time.Time) predicate.Note {
|
||||
return predicate.Note(sql.FieldLTE(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// SubjectEQ applies the EQ predicate on the "subject" field.
|
||||
func SubjectEQ(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldEQ(FieldSubject, v))
|
||||
}
|
||||
|
||||
// SubjectNEQ applies the NEQ predicate on the "subject" field.
|
||||
func SubjectNEQ(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldNEQ(FieldSubject, v))
|
||||
}
|
||||
|
||||
// SubjectIn applies the In predicate on the "subject" field.
|
||||
func SubjectIn(vs ...string) predicate.Note {
|
||||
return predicate.Note(sql.FieldIn(FieldSubject, vs...))
|
||||
}
|
||||
|
||||
// SubjectNotIn applies the NotIn predicate on the "subject" field.
|
||||
func SubjectNotIn(vs ...string) predicate.Note {
|
||||
return predicate.Note(sql.FieldNotIn(FieldSubject, vs...))
|
||||
}
|
||||
|
||||
// SubjectGT applies the GT predicate on the "subject" field.
|
||||
func SubjectGT(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldGT(FieldSubject, v))
|
||||
}
|
||||
|
||||
// SubjectGTE applies the GTE predicate on the "subject" field.
|
||||
func SubjectGTE(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldGTE(FieldSubject, v))
|
||||
}
|
||||
|
||||
// SubjectLT applies the LT predicate on the "subject" field.
|
||||
func SubjectLT(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldLT(FieldSubject, v))
|
||||
}
|
||||
|
||||
// SubjectLTE applies the LTE predicate on the "subject" field.
|
||||
func SubjectLTE(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldLTE(FieldSubject, v))
|
||||
}
|
||||
|
||||
// SubjectContains applies the Contains predicate on the "subject" field.
|
||||
func SubjectContains(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldContains(FieldSubject, v))
|
||||
}
|
||||
|
||||
// SubjectHasPrefix applies the HasPrefix predicate on the "subject" field.
|
||||
func SubjectHasPrefix(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldHasPrefix(FieldSubject, v))
|
||||
}
|
||||
|
||||
// SubjectHasSuffix applies the HasSuffix predicate on the "subject" field.
|
||||
func SubjectHasSuffix(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldHasSuffix(FieldSubject, v))
|
||||
}
|
||||
|
||||
// SubjectIsNil applies the IsNil predicate on the "subject" field.
|
||||
func SubjectIsNil() predicate.Note {
|
||||
return predicate.Note(sql.FieldIsNull(FieldSubject))
|
||||
}
|
||||
|
||||
// SubjectNotNil applies the NotNil predicate on the "subject" field.
|
||||
func SubjectNotNil() predicate.Note {
|
||||
return predicate.Note(sql.FieldNotNull(FieldSubject))
|
||||
}
|
||||
|
||||
// SubjectEqualFold applies the EqualFold predicate on the "subject" field.
|
||||
func SubjectEqualFold(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldEqualFold(FieldSubject, v))
|
||||
}
|
||||
|
||||
// SubjectContainsFold applies the ContainsFold predicate on the "subject" field.
|
||||
func SubjectContainsFold(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldContainsFold(FieldSubject, v))
|
||||
}
|
||||
|
||||
// ContentEQ applies the EQ predicate on the "content" field.
|
||||
func ContentEQ(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldEQ(FieldContent, v))
|
||||
}
|
||||
|
||||
// ContentNEQ applies the NEQ predicate on the "content" field.
|
||||
func ContentNEQ(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldNEQ(FieldContent, v))
|
||||
}
|
||||
|
||||
// ContentIn applies the In predicate on the "content" field.
|
||||
func ContentIn(vs ...string) predicate.Note {
|
||||
return predicate.Note(sql.FieldIn(FieldContent, vs...))
|
||||
}
|
||||
|
||||
// ContentNotIn applies the NotIn predicate on the "content" field.
|
||||
func ContentNotIn(vs ...string) predicate.Note {
|
||||
return predicate.Note(sql.FieldNotIn(FieldContent, vs...))
|
||||
}
|
||||
|
||||
// ContentGT applies the GT predicate on the "content" field.
|
||||
func ContentGT(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldGT(FieldContent, v))
|
||||
}
|
||||
|
||||
// ContentGTE applies the GTE predicate on the "content" field.
|
||||
func ContentGTE(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldGTE(FieldContent, v))
|
||||
}
|
||||
|
||||
// ContentLT applies the LT predicate on the "content" field.
|
||||
func ContentLT(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldLT(FieldContent, v))
|
||||
}
|
||||
|
||||
// ContentLTE applies the LTE predicate on the "content" field.
|
||||
func ContentLTE(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldLTE(FieldContent, v))
|
||||
}
|
||||
|
||||
// ContentContains applies the Contains predicate on the "content" field.
|
||||
func ContentContains(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldContains(FieldContent, v))
|
||||
}
|
||||
|
||||
// ContentHasPrefix applies the HasPrefix predicate on the "content" field.
|
||||
func ContentHasPrefix(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldHasPrefix(FieldContent, v))
|
||||
}
|
||||
|
||||
// ContentHasSuffix applies the HasSuffix predicate on the "content" field.
|
||||
func ContentHasSuffix(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldHasSuffix(FieldContent, v))
|
||||
}
|
||||
|
||||
// ContentEqualFold applies the EqualFold predicate on the "content" field.
|
||||
func ContentEqualFold(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldEqualFold(FieldContent, v))
|
||||
}
|
||||
|
||||
// ContentContainsFold applies the ContainsFold predicate on the "content" field.
|
||||
func ContentContainsFold(v string) predicate.Note {
|
||||
return predicate.Note(sql.FieldContainsFold(FieldContent, v))
|
||||
}
|
||||
|
||||
// IsSensitiveEQ applies the EQ predicate on the "isSensitive" field.
|
||||
func IsSensitiveEQ(v bool) predicate.Note {
|
||||
return predicate.Note(sql.FieldEQ(FieldIsSensitive, v))
|
||||
}
|
||||
|
||||
// IsSensitiveNEQ applies the NEQ predicate on the "isSensitive" field.
|
||||
func IsSensitiveNEQ(v bool) predicate.Note {
|
||||
return predicate.Note(sql.FieldNEQ(FieldIsSensitive, v))
|
||||
}
|
||||
|
||||
// VisibilityEQ applies the EQ predicate on the "visibility" field.
|
||||
func VisibilityEQ(v Visibility) predicate.Note {
|
||||
return predicate.Note(sql.FieldEQ(FieldVisibility, v))
|
||||
}
|
||||
|
||||
// VisibilityNEQ applies the NEQ predicate on the "visibility" field.
|
||||
func VisibilityNEQ(v Visibility) predicate.Note {
|
||||
return predicate.Note(sql.FieldNEQ(FieldVisibility, v))
|
||||
}
|
||||
|
||||
// VisibilityIn applies the In predicate on the "visibility" field.
|
||||
func VisibilityIn(vs ...Visibility) predicate.Note {
|
||||
return predicate.Note(sql.FieldIn(FieldVisibility, vs...))
|
||||
}
|
||||
|
||||
// VisibilityNotIn applies the NotIn predicate on the "visibility" field.
|
||||
func VisibilityNotIn(vs ...Visibility) predicate.Note {
|
||||
return predicate.Note(sql.FieldNotIn(FieldVisibility, vs...))
|
||||
}
|
||||
|
||||
// HasAuthor applies the HasEdge predicate on the "author" edge.
|
||||
func HasAuthor() predicate.Note {
|
||||
return predicate.Note(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, false, AuthorTable, AuthorColumn),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
})
|
||||
}
|
||||
|
||||
// HasAuthorWith applies the HasEdge predicate on the "author" edge with a given conditions (other predicates).
|
||||
func HasAuthorWith(preds ...predicate.User) predicate.Note {
|
||||
return predicate.Note(func(s *sql.Selector) {
|
||||
step := newAuthorStep()
|
||||
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
||||
for _, p := range preds {
|
||||
p(s)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// HasMentions applies the HasEdge predicate on the "mentions" edge.
|
||||
func HasMentions() predicate.Note {
|
||||
return predicate.Note(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2M, false, MentionsTable, MentionsPrimaryKey...),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
})
|
||||
}
|
||||
|
||||
// HasMentionsWith applies the HasEdge predicate on the "mentions" edge with a given conditions (other predicates).
|
||||
func HasMentionsWith(preds ...predicate.User) predicate.Note {
|
||||
return predicate.Note(func(s *sql.Selector) {
|
||||
step := newMentionsStep()
|
||||
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
||||
for _, p := range preds {
|
||||
p(s)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// HasAttachments applies the HasEdge predicate on the "attachments" edge.
|
||||
func HasAttachments() predicate.Note {
|
||||
return predicate.Note(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.O2M, false, AttachmentsTable, AttachmentsColumn),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
})
|
||||
}
|
||||
|
||||
// HasAttachmentsWith applies the HasEdge predicate on the "attachments" edge with a given conditions (other predicates).
|
||||
func HasAttachmentsWith(preds ...predicate.Attachment) predicate.Note {
|
||||
return predicate.Note(func(s *sql.Selector) {
|
||||
step := newAttachmentsStep()
|
||||
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
||||
for _, p := range preds {
|
||||
p(s)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// And groups predicates with the AND operator between them.
|
||||
func And(predicates ...predicate.Note) predicate.Note {
|
||||
return predicate.Note(sql.AndPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Or groups predicates with the OR operator between them.
|
||||
func Or(predicates ...predicate.Note) predicate.Note {
|
||||
return predicate.Note(sql.OrPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Not applies the not operator on the given predicate.
|
||||
func Not(p predicate.Note) predicate.Note {
|
||||
return predicate.Note(sql.NotPredicates(p))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue