snapshot of https://github.com/ent/ent.git (master, 2026-09-15; blobs > 131072B omitted)
This commit is contained in:
682
entc/integration/ent/task/mutation.go
Normal file
682
entc/integration/ent/task/mutation.go
Normal file
@@ -0,0 +1,682 @@
|
||||
// Copyright 2019-present Facebook Inc. All rights reserved.
|
||||
// This source code is licensed under the Apache 2.0 license found
|
||||
// in the LICENSE file in the root directory of this source tree.
|
||||
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package enttask
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/entc/integration/ent/predicate"
|
||||
"entgo.io/ent/entc/integration/ent/schema/task"
|
||||
)
|
||||
|
||||
// Mutation represents an operation that mutates the Task nodes in the graph.
|
||||
type Mutation struct {
|
||||
op ent.Op
|
||||
typ string
|
||||
priority *task.Priority
|
||||
addpriority *task.Priority
|
||||
priorities *map[string]task.Priority
|
||||
created_at *time.Time
|
||||
name *string
|
||||
owner *string
|
||||
_order *int
|
||||
add_order *int
|
||||
order_option *int
|
||||
addorder_option *int
|
||||
_op *string
|
||||
clearedFields map[string]struct{}
|
||||
predicates []predicate.Task
|
||||
}
|
||||
|
||||
// NewMutation creates a new Mutation for the Task entity.
|
||||
func NewMutation(op ent.Op) *Mutation {
|
||||
return &Mutation{
|
||||
op: op,
|
||||
typ: "Task",
|
||||
clearedFields: make(map[string]struct{}),
|
||||
}
|
||||
}
|
||||
|
||||
// Predicates returns the list of predicates set on the mutation.
|
||||
func (m *Mutation) Predicates() []predicate.Task {
|
||||
return m.predicates
|
||||
}
|
||||
|
||||
// SetPriority sets the "priority" field.
|
||||
func (m *Mutation) SetPriority(t task.Priority) {
|
||||
m.priority = &t
|
||||
m.addpriority = nil
|
||||
}
|
||||
|
||||
// Priority returns the value of the "priority" field in the mutation.
|
||||
func (m *Mutation) Priority() (r task.Priority, exists bool) {
|
||||
v := m.priority
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// AddPriority adds t to the "priority" field.
|
||||
func (m *Mutation) AddPriority(t task.Priority) {
|
||||
if m.addpriority != nil {
|
||||
*m.addpriority += t
|
||||
} else {
|
||||
m.addpriority = &t
|
||||
}
|
||||
}
|
||||
|
||||
// AddedPriority returns the value that was added to the "priority" field in this mutation.
|
||||
func (m *Mutation) AddedPriority() (r task.Priority, exists bool) {
|
||||
v := m.addpriority
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// ResetPriority resets all changes to the "priority" field.
|
||||
func (m *Mutation) ResetPriority() {
|
||||
m.priority = nil
|
||||
m.addpriority = nil
|
||||
}
|
||||
|
||||
// SetPriorities sets the "priorities" field.
|
||||
func (m *Mutation) SetPriorities(value map[string]task.Priority) {
|
||||
m.priorities = &value
|
||||
}
|
||||
|
||||
// Priorities returns the value of the "priorities" field in the mutation.
|
||||
func (m *Mutation) Priorities() (r map[string]task.Priority, exists bool) {
|
||||
v := m.priorities
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// ClearPriorities clears the value of the "priorities" field.
|
||||
func (m *Mutation) ClearPriorities() {
|
||||
m.priorities = nil
|
||||
m.clearedFields[FieldPriorities] = struct{}{}
|
||||
}
|
||||
|
||||
// PrioritiesCleared returns if the "priorities" field was cleared in this mutation.
|
||||
func (m *Mutation) PrioritiesCleared() bool {
|
||||
_, ok := m.clearedFields[FieldPriorities]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetPriorities resets all changes to the "priorities" field.
|
||||
func (m *Mutation) ResetPriorities() {
|
||||
m.priorities = nil
|
||||
delete(m.clearedFields, FieldPriorities)
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "created_at" field.
|
||||
func (m *Mutation) SetCreatedAt(t time.Time) {
|
||||
m.created_at = &t
|
||||
}
|
||||
|
||||
// CreatedAt returns the value of the "created_at" field in the mutation.
|
||||
func (m *Mutation) CreatedAt() (r time.Time, exists bool) {
|
||||
v := m.created_at
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// ResetCreatedAt resets all changes to the "created_at" field.
|
||||
func (m *Mutation) ResetCreatedAt() {
|
||||
m.created_at = nil
|
||||
}
|
||||
|
||||
// SetName sets the "name" field.
|
||||
func (m *Mutation) SetName(s string) {
|
||||
m.name = &s
|
||||
}
|
||||
|
||||
// Name returns the value of the "name" field in the mutation.
|
||||
func (m *Mutation) Name() (r string, exists bool) {
|
||||
v := m.name
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// ClearName clears the value of the "name" field.
|
||||
func (m *Mutation) ClearName() {
|
||||
m.name = nil
|
||||
m.clearedFields[FieldName] = struct{}{}
|
||||
}
|
||||
|
||||
// NameCleared returns if the "name" field was cleared in this mutation.
|
||||
func (m *Mutation) NameCleared() bool {
|
||||
_, ok := m.clearedFields[FieldName]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetName resets all changes to the "name" field.
|
||||
func (m *Mutation) ResetName() {
|
||||
m.name = nil
|
||||
delete(m.clearedFields, FieldName)
|
||||
}
|
||||
|
||||
// SetOwner sets the "owner" field.
|
||||
func (m *Mutation) SetOwner(s string) {
|
||||
m.owner = &s
|
||||
}
|
||||
|
||||
// Owner returns the value of the "owner" field in the mutation.
|
||||
func (m *Mutation) Owner() (r string, exists bool) {
|
||||
v := m.owner
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// ClearOwner clears the value of the "owner" field.
|
||||
func (m *Mutation) ClearOwner() {
|
||||
m.owner = nil
|
||||
m.clearedFields[FieldOwner] = struct{}{}
|
||||
}
|
||||
|
||||
// OwnerCleared returns if the "owner" field was cleared in this mutation.
|
||||
func (m *Mutation) OwnerCleared() bool {
|
||||
_, ok := m.clearedFields[FieldOwner]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetOwner resets all changes to the "owner" field.
|
||||
func (m *Mutation) ResetOwner() {
|
||||
m.owner = nil
|
||||
delete(m.clearedFields, FieldOwner)
|
||||
}
|
||||
|
||||
// SetOrder sets the "order" field.
|
||||
func (m *Mutation) SetOrder(i int) {
|
||||
m._order = &i
|
||||
m.add_order = nil
|
||||
}
|
||||
|
||||
// Order returns the value of the "order" field in the mutation.
|
||||
func (m *Mutation) Order() (r int, exists bool) {
|
||||
v := m._order
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// AddOrder adds i to the "order" field.
|
||||
func (m *Mutation) AddOrder(i int) {
|
||||
if m.add_order != nil {
|
||||
*m.add_order += i
|
||||
} else {
|
||||
m.add_order = &i
|
||||
}
|
||||
}
|
||||
|
||||
// AddedOrder returns the value that was added to the "order" field in this mutation.
|
||||
func (m *Mutation) AddedOrder() (r int, exists bool) {
|
||||
v := m.add_order
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// ClearOrder clears the value of the "order" field.
|
||||
func (m *Mutation) ClearOrder() {
|
||||
m._order = nil
|
||||
m.add_order = nil
|
||||
m.clearedFields[FieldOrder] = struct{}{}
|
||||
}
|
||||
|
||||
// OrderCleared returns if the "order" field was cleared in this mutation.
|
||||
func (m *Mutation) OrderCleared() bool {
|
||||
_, ok := m.clearedFields[FieldOrder]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetOrder resets all changes to the "order" field.
|
||||
func (m *Mutation) ResetOrder() {
|
||||
m._order = nil
|
||||
m.add_order = nil
|
||||
delete(m.clearedFields, FieldOrder)
|
||||
}
|
||||
|
||||
// SetOrderOption sets the "order_option" field.
|
||||
func (m *Mutation) SetOrderOption(i int) {
|
||||
m.order_option = &i
|
||||
m.addorder_option = nil
|
||||
}
|
||||
|
||||
// OrderOption returns the value of the "order_option" field in the mutation.
|
||||
func (m *Mutation) OrderOption() (r int, exists bool) {
|
||||
v := m.order_option
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// AddOrderOption adds i to the "order_option" field.
|
||||
func (m *Mutation) AddOrderOption(i int) {
|
||||
if m.addorder_option != nil {
|
||||
*m.addorder_option += i
|
||||
} else {
|
||||
m.addorder_option = &i
|
||||
}
|
||||
}
|
||||
|
||||
// AddedOrderOption returns the value that was added to the "order_option" field in this mutation.
|
||||
func (m *Mutation) AddedOrderOption() (r int, exists bool) {
|
||||
v := m.addorder_option
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// ClearOrderOption clears the value of the "order_option" field.
|
||||
func (m *Mutation) ClearOrderOption() {
|
||||
m.order_option = nil
|
||||
m.addorder_option = nil
|
||||
m.clearedFields[FieldOrderOption] = struct{}{}
|
||||
}
|
||||
|
||||
// OrderOptionCleared returns if the "order_option" field was cleared in this mutation.
|
||||
func (m *Mutation) OrderOptionCleared() bool {
|
||||
_, ok := m.clearedFields[FieldOrderOption]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetOrderOption resets all changes to the "order_option" field.
|
||||
func (m *Mutation) ResetOrderOption() {
|
||||
m.order_option = nil
|
||||
m.addorder_option = nil
|
||||
delete(m.clearedFields, FieldOrderOption)
|
||||
}
|
||||
|
||||
// SetOpField sets the "op" field.
|
||||
func (m *Mutation) SetOpField(s string) {
|
||||
m._op = &s
|
||||
}
|
||||
|
||||
// GetOp returns the value of the "op" field in the mutation.
|
||||
func (m *Mutation) GetOp() (r string, exists bool) {
|
||||
v := m._op
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// ResetOp resets all changes to the "op" field.
|
||||
func (m *Mutation) ResetOp() {
|
||||
m._op = nil
|
||||
}
|
||||
|
||||
// Where appends a list predicates to the Mutation builder.
|
||||
func (m *Mutation) Where(ps ...predicate.Task) {
|
||||
m.predicates = append(m.predicates, ps...)
|
||||
}
|
||||
|
||||
// WhereP appends storage-level predicates to the Mutation builder. Using this method,
|
||||
// users can use type-assertion to append predicates that do not depend on any generated package.
|
||||
func (m *Mutation) WhereP(ps ...func(*sql.Selector)) {
|
||||
p := make([]predicate.Task, len(ps))
|
||||
for i := range ps {
|
||||
p[i] = ps[i]
|
||||
}
|
||||
m.Where(p...)
|
||||
}
|
||||
|
||||
// Op returns the operation name.
|
||||
func (m *Mutation) Op() ent.Op {
|
||||
return m.op
|
||||
}
|
||||
|
||||
// SetOp allows setting the mutation operation.
|
||||
func (m *Mutation) SetOp(op ent.Op) {
|
||||
m.op = op
|
||||
}
|
||||
|
||||
// Type returns the node type of this mutation (Task).
|
||||
func (m *Mutation) Type() string {
|
||||
return m.typ
|
||||
}
|
||||
|
||||
// Fields returns all fields that were changed during this mutation. Note that in
|
||||
// order to get all numeric fields that were incremented/decremented, call
|
||||
// AddedFields().
|
||||
func (m *Mutation) Fields() []string {
|
||||
fields := make([]string, 0, 8)
|
||||
if m.priority != nil {
|
||||
fields = append(fields, FieldPriority)
|
||||
}
|
||||
if m.priorities != nil {
|
||||
fields = append(fields, FieldPriorities)
|
||||
}
|
||||
if m.created_at != nil {
|
||||
fields = append(fields, FieldCreatedAt)
|
||||
}
|
||||
if m.name != nil {
|
||||
fields = append(fields, FieldName)
|
||||
}
|
||||
if m.owner != nil {
|
||||
fields = append(fields, FieldOwner)
|
||||
}
|
||||
if m._order != nil {
|
||||
fields = append(fields, FieldOrder)
|
||||
}
|
||||
if m.order_option != nil {
|
||||
fields = append(fields, FieldOrderOption)
|
||||
}
|
||||
if m._op != nil {
|
||||
fields = append(fields, FieldOp)
|
||||
}
|
||||
return fields
|
||||
}
|
||||
|
||||
// Field returns the value of a field with the given name. The second boolean
|
||||
// return value indicates that this field was not set, or was not defined in the
|
||||
// schema.
|
||||
func (m *Mutation) Field(name string) (ent.Value, bool) {
|
||||
switch name {
|
||||
case FieldPriority:
|
||||
return m.Priority()
|
||||
case FieldPriorities:
|
||||
return m.Priorities()
|
||||
case FieldCreatedAt:
|
||||
return m.CreatedAt()
|
||||
case FieldName:
|
||||
return m.Name()
|
||||
case FieldOwner:
|
||||
return m.Owner()
|
||||
case FieldOrder:
|
||||
return m.Order()
|
||||
case FieldOrderOption:
|
||||
return m.OrderOption()
|
||||
case FieldOp:
|
||||
return m.GetOp()
|
||||
}
|
||||
return nil, false
|
||||
}
|
||||
|
||||
// OldField returns the old value of the field from the database. An error is
|
||||
// returned if the mutation operation is not UpdateOne, or the query to the
|
||||
// database failed.
|
||||
func (m *Mutation) OldField(ctx context.Context, name string) (ent.Value, error) {
|
||||
return nil, fmt.Errorf("unknown Task field %s", name)
|
||||
}
|
||||
|
||||
// SetField sets the value of a field with the given name. It returns an error if
|
||||
// the field is not defined in the schema, or if the type mismatched the field
|
||||
// type.
|
||||
func (m *Mutation) SetField(name string, value ent.Value) error {
|
||||
switch name {
|
||||
case FieldPriority:
|
||||
v, ok := value.(task.Priority)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetPriority(v)
|
||||
return nil
|
||||
case FieldPriorities:
|
||||
v, ok := value.(map[string]task.Priority)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetPriorities(v)
|
||||
return nil
|
||||
case FieldCreatedAt:
|
||||
v, ok := value.(time.Time)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetCreatedAt(v)
|
||||
return nil
|
||||
case FieldName:
|
||||
v, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetName(v)
|
||||
return nil
|
||||
case FieldOwner:
|
||||
v, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetOwner(v)
|
||||
return nil
|
||||
case FieldOrder:
|
||||
v, ok := value.(int)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetOrder(v)
|
||||
return nil
|
||||
case FieldOrderOption:
|
||||
v, ok := value.(int)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetOrderOption(v)
|
||||
return nil
|
||||
case FieldOp:
|
||||
v, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetOpField(v)
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unknown Task field %s", name)
|
||||
}
|
||||
|
||||
// AddedFields returns all numeric fields that were incremented/decremented during
|
||||
// this mutation.
|
||||
func (m *Mutation) AddedFields() []string {
|
||||
var fields []string
|
||||
if m.addpriority != nil {
|
||||
fields = append(fields, FieldPriority)
|
||||
}
|
||||
if m.add_order != nil {
|
||||
fields = append(fields, FieldOrder)
|
||||
}
|
||||
if m.addorder_option != nil {
|
||||
fields = append(fields, FieldOrderOption)
|
||||
}
|
||||
return fields
|
||||
}
|
||||
|
||||
// AddedField returns the numeric value that was incremented/decremented on a field
|
||||
// with the given name. The second boolean return value indicates that this field
|
||||
// was not set, or was not defined in the schema.
|
||||
func (m *Mutation) AddedField(name string) (ent.Value, bool) {
|
||||
switch name {
|
||||
case FieldPriority:
|
||||
return m.AddedPriority()
|
||||
case FieldOrder:
|
||||
return m.AddedOrder()
|
||||
case FieldOrderOption:
|
||||
return m.AddedOrderOption()
|
||||
}
|
||||
return nil, false
|
||||
}
|
||||
|
||||
// AddField adds the value to the field with the given name. It returns an error if
|
||||
// the field is not defined in the schema, or if the type mismatched the field
|
||||
// type.
|
||||
func (m *Mutation) AddField(name string, value ent.Value) error {
|
||||
switch name {
|
||||
case FieldPriority:
|
||||
v, ok := value.(task.Priority)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.AddPriority(v)
|
||||
return nil
|
||||
case FieldOrder:
|
||||
v, ok := value.(int)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.AddOrder(v)
|
||||
return nil
|
||||
case FieldOrderOption:
|
||||
v, ok := value.(int)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.AddOrderOption(v)
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unknown Task numeric field %s", name)
|
||||
}
|
||||
|
||||
// ClearedFields returns all nullable fields that were cleared during this
|
||||
// mutation.
|
||||
func (m *Mutation) ClearedFields() []string {
|
||||
var fields []string
|
||||
if m.FieldCleared(FieldPriorities) {
|
||||
fields = append(fields, FieldPriorities)
|
||||
}
|
||||
if m.FieldCleared(FieldName) {
|
||||
fields = append(fields, FieldName)
|
||||
}
|
||||
if m.FieldCleared(FieldOwner) {
|
||||
fields = append(fields, FieldOwner)
|
||||
}
|
||||
if m.FieldCleared(FieldOrder) {
|
||||
fields = append(fields, FieldOrder)
|
||||
}
|
||||
if m.FieldCleared(FieldOrderOption) {
|
||||
fields = append(fields, FieldOrderOption)
|
||||
}
|
||||
return fields
|
||||
}
|
||||
|
||||
// FieldCleared returns a boolean indicating if a field with the given name was
|
||||
// cleared in this mutation.
|
||||
func (m *Mutation) FieldCleared(name string) bool {
|
||||
_, ok := m.clearedFields[name]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ClearField clears the value of the field with the given name. It returns an
|
||||
// error if the field is not defined in the schema.
|
||||
func (m *Mutation) ClearField(name string) error {
|
||||
switch name {
|
||||
case FieldPriorities:
|
||||
m.ClearPriorities()
|
||||
return nil
|
||||
case FieldName:
|
||||
m.ClearName()
|
||||
return nil
|
||||
case FieldOwner:
|
||||
m.ClearOwner()
|
||||
return nil
|
||||
case FieldOrder:
|
||||
m.ClearOrder()
|
||||
return nil
|
||||
case FieldOrderOption:
|
||||
m.ClearOrderOption()
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unknown Task nullable field %s", name)
|
||||
}
|
||||
|
||||
// ResetField resets all changes in the mutation for the field with the given name.
|
||||
// It returns an error if the field is not defined in the schema.
|
||||
func (m *Mutation) ResetField(name string) error {
|
||||
switch name {
|
||||
case FieldPriority:
|
||||
m.ResetPriority()
|
||||
return nil
|
||||
case FieldPriorities:
|
||||
m.ResetPriorities()
|
||||
return nil
|
||||
case FieldCreatedAt:
|
||||
m.ResetCreatedAt()
|
||||
return nil
|
||||
case FieldName:
|
||||
m.ResetName()
|
||||
return nil
|
||||
case FieldOwner:
|
||||
m.ResetOwner()
|
||||
return nil
|
||||
case FieldOrder:
|
||||
m.ResetOrder()
|
||||
return nil
|
||||
case FieldOrderOption:
|
||||
m.ResetOrderOption()
|
||||
return nil
|
||||
case FieldOp:
|
||||
m.ResetOp()
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unknown Task field %s", name)
|
||||
}
|
||||
|
||||
// AddedEdges returns all edge names that were set/added in this mutation.
|
||||
func (m *Mutation) AddedEdges() []string {
|
||||
edges := make([]string, 0, 0)
|
||||
return edges
|
||||
}
|
||||
|
||||
// AddedIDs returns all IDs (to other nodes) that were added for the given edge
|
||||
// name in this mutation.
|
||||
func (m *Mutation) AddedIDs(name string) []ent.Value {
|
||||
return nil
|
||||
}
|
||||
|
||||
// RemovedEdges returns all edge names that were removed in this mutation.
|
||||
func (m *Mutation) RemovedEdges() []string {
|
||||
edges := make([]string, 0, 0)
|
||||
return edges
|
||||
}
|
||||
|
||||
// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with
|
||||
// the given name in this mutation.
|
||||
func (m *Mutation) RemovedIDs(name string) []ent.Value {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ClearedEdges returns all edge names that were cleared in this mutation.
|
||||
func (m *Mutation) ClearedEdges() []string {
|
||||
edges := make([]string, 0, 0)
|
||||
return edges
|
||||
}
|
||||
|
||||
// EdgeCleared returns a boolean which indicates if the edge with the given name
|
||||
// was cleared in this mutation.
|
||||
func (m *Mutation) EdgeCleared(name string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// ClearEdge clears the value of the edge with the given name. It returns an error
|
||||
// if that edge is not defined in the schema.
|
||||
func (m *Mutation) ClearEdge(name string) error {
|
||||
return fmt.Errorf("unknown Task unique edge %s", name)
|
||||
}
|
||||
|
||||
// ResetEdge resets all changes to the edge with the given name in this mutation.
|
||||
// It returns an error if the edge is not defined in the schema.
|
||||
func (m *Mutation) ResetEdge(name string) error {
|
||||
return fmt.Errorf("unknown Task edge %s", name)
|
||||
}
|
||||
122
entc/integration/ent/task/task.go
Normal file
122
entc/integration/ent/task/task.go
Normal file
@@ -0,0 +1,122 @@
|
||||
// Copyright 2019-present Facebook Inc. All rights reserved.
|
||||
// This source code is licensed under the Apache 2.0 license found
|
||||
// in the LICENSE file in the root directory of this source tree.
|
||||
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package enttask
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/entc/integration/ent/schema/task"
|
||||
)
|
||||
|
||||
const (
|
||||
// Label holds the string label denoting the task type in the database.
|
||||
Label = "task"
|
||||
// FieldID holds the string denoting the id field in the database.
|
||||
FieldID = "id"
|
||||
// FieldPriority holds the string denoting the priority field in the database.
|
||||
FieldPriority = "priority"
|
||||
// FieldPriorities holds the string denoting the priorities field in the database.
|
||||
FieldPriorities = "priorities"
|
||||
// FieldCreatedAt holds the string denoting the created_at field in the database.
|
||||
FieldCreatedAt = "created_at"
|
||||
// FieldName holds the string denoting the name field in the database.
|
||||
FieldName = "name"
|
||||
// FieldOwner holds the string denoting the owner field in the database.
|
||||
FieldOwner = "owner"
|
||||
// FieldOrder holds the string denoting the order field in the database.
|
||||
FieldOrder = "order"
|
||||
// FieldOrderOption holds the string denoting the order_option field in the database.
|
||||
FieldOrderOption = "order_option"
|
||||
// FieldOp holds the string denoting the op field in the database.
|
||||
FieldOp = "op"
|
||||
// Table holds the table name of the task in the database.
|
||||
Table = "tasks"
|
||||
)
|
||||
|
||||
// Columns holds all SQL columns for task fields.
|
||||
var Columns = []string{
|
||||
FieldID,
|
||||
FieldPriority,
|
||||
FieldPriorities,
|
||||
FieldCreatedAt,
|
||||
FieldOwner,
|
||||
FieldOrder,
|
||||
FieldOrderOption,
|
||||
FieldOp,
|
||||
}
|
||||
|
||||
// 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 _, f := range [...]string{FieldName} {
|
||||
if column == f {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var (
|
||||
// DefaultPriority holds the default value on creation for the "priority" field.
|
||||
DefaultPriority task.Priority
|
||||
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
|
||||
DefaultCreatedAt func() time.Time
|
||||
// DefaultOp holds the default value on creation for the "op" field.
|
||||
DefaultOp string
|
||||
// OpValidator is a validator for the "op" field. It is called by the builders before save.
|
||||
OpValidator func(string) error
|
||||
)
|
||||
|
||||
// OrderOption defines the ordering options for the Task 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()
|
||||
}
|
||||
|
||||
// ByPriority orders the results by the priority field.
|
||||
func ByPriority(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldPriority, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByCreatedAt orders the results by the created_at field.
|
||||
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByName orders the results by the name field.
|
||||
func ByName(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldName, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByOwner orders the results by the owner field.
|
||||
func ByOwner(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldOwner, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByOrder orders the results by the order field.
|
||||
func ByOrder(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldOrder, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByOrderOption orders the results by the order_option field.
|
||||
func ByOrderOption(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldOrderOption, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByOp orders the results by the op field.
|
||||
func ByOp(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldOp, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// comment from another template.
|
||||
525
entc/integration/ent/task/where.go
Normal file
525
entc/integration/ent/task/where.go
Normal file
@@ -0,0 +1,525 @@
|
||||
// Copyright 2019-present Facebook Inc. All rights reserved.
|
||||
// This source code is licensed under the Apache 2.0 license found
|
||||
// in the LICENSE file in the root directory of this source tree.
|
||||
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package enttask
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/entc/integration/ent/predicate"
|
||||
"entgo.io/ent/entc/integration/ent/schema/task"
|
||||
)
|
||||
|
||||
// ID filters vertices based on their ID field.
|
||||
func ID(id int) predicate.Task {
|
||||
return predicate.Task(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDEQ applies the EQ predicate on the ID field.
|
||||
func IDEQ(id int) predicate.Task {
|
||||
return predicate.Task(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDNEQ applies the NEQ predicate on the ID field.
|
||||
func IDNEQ(id int) predicate.Task {
|
||||
return predicate.Task(sql.FieldNEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDIn applies the In predicate on the ID field.
|
||||
func IDIn(ids ...int) predicate.Task {
|
||||
return predicate.Task(sql.FieldIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDNotIn applies the NotIn predicate on the ID field.
|
||||
func IDNotIn(ids ...int) predicate.Task {
|
||||
return predicate.Task(sql.FieldNotIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDGT applies the GT predicate on the ID field.
|
||||
func IDGT(id int) predicate.Task {
|
||||
return predicate.Task(sql.FieldGT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDGTE applies the GTE predicate on the ID field.
|
||||
func IDGTE(id int) predicate.Task {
|
||||
return predicate.Task(sql.FieldGTE(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLT applies the LT predicate on the ID field.
|
||||
func IDLT(id int) predicate.Task {
|
||||
return predicate.Task(sql.FieldLT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLTE applies the LTE predicate on the ID field.
|
||||
func IDLTE(id int) predicate.Task {
|
||||
return predicate.Task(sql.FieldLTE(FieldID, id))
|
||||
}
|
||||
|
||||
// Priority applies equality check predicate on the "priority" field. It's identical to PriorityEQ.
|
||||
func Priority(v task.Priority) predicate.Task {
|
||||
vc := int(v)
|
||||
return predicate.Task(sql.FieldEQ(FieldPriority, vc))
|
||||
}
|
||||
|
||||
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
|
||||
func CreatedAt(v time.Time) predicate.Task {
|
||||
return predicate.Task(sql.FieldEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// Name applies equality check predicate on the "name" field. It's identical to NameEQ.
|
||||
func Name(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldEQ(FieldName, v))
|
||||
}
|
||||
|
||||
// Owner applies equality check predicate on the "owner" field. It's identical to OwnerEQ.
|
||||
func Owner(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldEQ(FieldOwner, v))
|
||||
}
|
||||
|
||||
// Order applies equality check predicate on the "order" field. It's identical to OrderEQ.
|
||||
func Order(v int) predicate.Task {
|
||||
return predicate.Task(sql.FieldEQ(FieldOrder, v))
|
||||
}
|
||||
|
||||
// Op applies equality check predicate on the "op" field. It's identical to OpEQ.
|
||||
func Op(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldEQ(FieldOp, v))
|
||||
}
|
||||
|
||||
// PriorityEQ applies the EQ predicate on the "priority" field.
|
||||
func PriorityEQ(v task.Priority) predicate.Task {
|
||||
vc := int(v)
|
||||
return predicate.Task(sql.FieldEQ(FieldPriority, vc))
|
||||
}
|
||||
|
||||
// PriorityNEQ applies the NEQ predicate on the "priority" field.
|
||||
func PriorityNEQ(v task.Priority) predicate.Task {
|
||||
vc := int(v)
|
||||
return predicate.Task(sql.FieldNEQ(FieldPriority, vc))
|
||||
}
|
||||
|
||||
// PriorityIn applies the In predicate on the "priority" field.
|
||||
func PriorityIn(vs ...task.Priority) predicate.Task {
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = int(vs[i])
|
||||
}
|
||||
return predicate.Task(sql.FieldIn(FieldPriority, v...))
|
||||
}
|
||||
|
||||
// PriorityNotIn applies the NotIn predicate on the "priority" field.
|
||||
func PriorityNotIn(vs ...task.Priority) predicate.Task {
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = int(vs[i])
|
||||
}
|
||||
return predicate.Task(sql.FieldNotIn(FieldPriority, v...))
|
||||
}
|
||||
|
||||
// PriorityGT applies the GT predicate on the "priority" field.
|
||||
func PriorityGT(v task.Priority) predicate.Task {
|
||||
vc := int(v)
|
||||
return predicate.Task(sql.FieldGT(FieldPriority, vc))
|
||||
}
|
||||
|
||||
// PriorityGTE applies the GTE predicate on the "priority" field.
|
||||
func PriorityGTE(v task.Priority) predicate.Task {
|
||||
vc := int(v)
|
||||
return predicate.Task(sql.FieldGTE(FieldPriority, vc))
|
||||
}
|
||||
|
||||
// PriorityLT applies the LT predicate on the "priority" field.
|
||||
func PriorityLT(v task.Priority) predicate.Task {
|
||||
vc := int(v)
|
||||
return predicate.Task(sql.FieldLT(FieldPriority, vc))
|
||||
}
|
||||
|
||||
// PriorityLTE applies the LTE predicate on the "priority" field.
|
||||
func PriorityLTE(v task.Priority) predicate.Task {
|
||||
vc := int(v)
|
||||
return predicate.Task(sql.FieldLTE(FieldPriority, vc))
|
||||
}
|
||||
|
||||
// PrioritiesIsNil applies the IsNil predicate on the "priorities" field.
|
||||
func PrioritiesIsNil() predicate.Task {
|
||||
return predicate.Task(sql.FieldIsNull(FieldPriorities))
|
||||
}
|
||||
|
||||
// PrioritiesNotNil applies the NotNil predicate on the "priorities" field.
|
||||
func PrioritiesNotNil() predicate.Task {
|
||||
return predicate.Task(sql.FieldNotNull(FieldPriorities))
|
||||
}
|
||||
|
||||
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
|
||||
func CreatedAtEQ(v time.Time) predicate.Task {
|
||||
return predicate.Task(sql.FieldEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
|
||||
func CreatedAtNEQ(v time.Time) predicate.Task {
|
||||
return predicate.Task(sql.FieldNEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtIn applies the In predicate on the "created_at" field.
|
||||
func CreatedAtIn(vs ...time.Time) predicate.Task {
|
||||
return predicate.Task(sql.FieldIn(FieldCreatedAt, vs...))
|
||||
}
|
||||
|
||||
// CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
|
||||
func CreatedAtNotIn(vs ...time.Time) predicate.Task {
|
||||
return predicate.Task(sql.FieldNotIn(FieldCreatedAt, vs...))
|
||||
}
|
||||
|
||||
// CreatedAtGT applies the GT predicate on the "created_at" field.
|
||||
func CreatedAtGT(v time.Time) predicate.Task {
|
||||
return predicate.Task(sql.FieldGT(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtGTE applies the GTE predicate on the "created_at" field.
|
||||
func CreatedAtGTE(v time.Time) predicate.Task {
|
||||
return predicate.Task(sql.FieldGTE(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtLT applies the LT predicate on the "created_at" field.
|
||||
func CreatedAtLT(v time.Time) predicate.Task {
|
||||
return predicate.Task(sql.FieldLT(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtLTE applies the LTE predicate on the "created_at" field.
|
||||
func CreatedAtLTE(v time.Time) predicate.Task {
|
||||
return predicate.Task(sql.FieldLTE(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// NameEQ applies the EQ predicate on the "name" field.
|
||||
func NameEQ(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldEQ(FieldName, v))
|
||||
}
|
||||
|
||||
// NameNEQ applies the NEQ predicate on the "name" field.
|
||||
func NameNEQ(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldNEQ(FieldName, v))
|
||||
}
|
||||
|
||||
// NameIn applies the In predicate on the "name" field.
|
||||
func NameIn(vs ...string) predicate.Task {
|
||||
return predicate.Task(sql.FieldIn(FieldName, vs...))
|
||||
}
|
||||
|
||||
// NameNotIn applies the NotIn predicate on the "name" field.
|
||||
func NameNotIn(vs ...string) predicate.Task {
|
||||
return predicate.Task(sql.FieldNotIn(FieldName, vs...))
|
||||
}
|
||||
|
||||
// NameGT applies the GT predicate on the "name" field.
|
||||
func NameGT(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldGT(FieldName, v))
|
||||
}
|
||||
|
||||
// NameGTE applies the GTE predicate on the "name" field.
|
||||
func NameGTE(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldGTE(FieldName, v))
|
||||
}
|
||||
|
||||
// NameLT applies the LT predicate on the "name" field.
|
||||
func NameLT(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldLT(FieldName, v))
|
||||
}
|
||||
|
||||
// NameLTE applies the LTE predicate on the "name" field.
|
||||
func NameLTE(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldLTE(FieldName, v))
|
||||
}
|
||||
|
||||
// NameContains applies the Contains predicate on the "name" field.
|
||||
func NameContains(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldContains(FieldName, v))
|
||||
}
|
||||
|
||||
// NameHasPrefix applies the HasPrefix predicate on the "name" field.
|
||||
func NameHasPrefix(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldHasPrefix(FieldName, v))
|
||||
}
|
||||
|
||||
// NameHasSuffix applies the HasSuffix predicate on the "name" field.
|
||||
func NameHasSuffix(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldHasSuffix(FieldName, v))
|
||||
}
|
||||
|
||||
// NameIsNil applies the IsNil predicate on the "name" field.
|
||||
func NameIsNil() predicate.Task {
|
||||
return predicate.Task(sql.FieldIsNull(FieldName))
|
||||
}
|
||||
|
||||
// NameNotNil applies the NotNil predicate on the "name" field.
|
||||
func NameNotNil() predicate.Task {
|
||||
return predicate.Task(sql.FieldNotNull(FieldName))
|
||||
}
|
||||
|
||||
// NameEqualFold applies the EqualFold predicate on the "name" field.
|
||||
func NameEqualFold(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldEqualFold(FieldName, v))
|
||||
}
|
||||
|
||||
// NameContainsFold applies the ContainsFold predicate on the "name" field.
|
||||
func NameContainsFold(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldContainsFold(FieldName, v))
|
||||
}
|
||||
|
||||
// OwnerEQ applies the EQ predicate on the "owner" field.
|
||||
func OwnerEQ(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldEQ(FieldOwner, v))
|
||||
}
|
||||
|
||||
// OwnerNEQ applies the NEQ predicate on the "owner" field.
|
||||
func OwnerNEQ(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldNEQ(FieldOwner, v))
|
||||
}
|
||||
|
||||
// OwnerIn applies the In predicate on the "owner" field.
|
||||
func OwnerIn(vs ...string) predicate.Task {
|
||||
return predicate.Task(sql.FieldIn(FieldOwner, vs...))
|
||||
}
|
||||
|
||||
// OwnerNotIn applies the NotIn predicate on the "owner" field.
|
||||
func OwnerNotIn(vs ...string) predicate.Task {
|
||||
return predicate.Task(sql.FieldNotIn(FieldOwner, vs...))
|
||||
}
|
||||
|
||||
// OwnerGT applies the GT predicate on the "owner" field.
|
||||
func OwnerGT(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldGT(FieldOwner, v))
|
||||
}
|
||||
|
||||
// OwnerGTE applies the GTE predicate on the "owner" field.
|
||||
func OwnerGTE(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldGTE(FieldOwner, v))
|
||||
}
|
||||
|
||||
// OwnerLT applies the LT predicate on the "owner" field.
|
||||
func OwnerLT(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldLT(FieldOwner, v))
|
||||
}
|
||||
|
||||
// OwnerLTE applies the LTE predicate on the "owner" field.
|
||||
func OwnerLTE(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldLTE(FieldOwner, v))
|
||||
}
|
||||
|
||||
// OwnerContains applies the Contains predicate on the "owner" field.
|
||||
func OwnerContains(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldContains(FieldOwner, v))
|
||||
}
|
||||
|
||||
// OwnerHasPrefix applies the HasPrefix predicate on the "owner" field.
|
||||
func OwnerHasPrefix(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldHasPrefix(FieldOwner, v))
|
||||
}
|
||||
|
||||
// OwnerHasSuffix applies the HasSuffix predicate on the "owner" field.
|
||||
func OwnerHasSuffix(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldHasSuffix(FieldOwner, v))
|
||||
}
|
||||
|
||||
// OwnerIsNil applies the IsNil predicate on the "owner" field.
|
||||
func OwnerIsNil() predicate.Task {
|
||||
return predicate.Task(sql.FieldIsNull(FieldOwner))
|
||||
}
|
||||
|
||||
// OwnerNotNil applies the NotNil predicate on the "owner" field.
|
||||
func OwnerNotNil() predicate.Task {
|
||||
return predicate.Task(sql.FieldNotNull(FieldOwner))
|
||||
}
|
||||
|
||||
// OwnerEqualFold applies the EqualFold predicate on the "owner" field.
|
||||
func OwnerEqualFold(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldEqualFold(FieldOwner, v))
|
||||
}
|
||||
|
||||
// OwnerContainsFold applies the ContainsFold predicate on the "owner" field.
|
||||
func OwnerContainsFold(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldContainsFold(FieldOwner, v))
|
||||
}
|
||||
|
||||
// OrderEQ applies the EQ predicate on the "order" field.
|
||||
func OrderEQ(v int) predicate.Task {
|
||||
return predicate.Task(sql.FieldEQ(FieldOrder, v))
|
||||
}
|
||||
|
||||
// OrderNEQ applies the NEQ predicate on the "order" field.
|
||||
func OrderNEQ(v int) predicate.Task {
|
||||
return predicate.Task(sql.FieldNEQ(FieldOrder, v))
|
||||
}
|
||||
|
||||
// OrderIn applies the In predicate on the "order" field.
|
||||
func OrderIn(vs ...int) predicate.Task {
|
||||
return predicate.Task(sql.FieldIn(FieldOrder, vs...))
|
||||
}
|
||||
|
||||
// OrderNotIn applies the NotIn predicate on the "order" field.
|
||||
func OrderNotIn(vs ...int) predicate.Task {
|
||||
return predicate.Task(sql.FieldNotIn(FieldOrder, vs...))
|
||||
}
|
||||
|
||||
// OrderGT applies the GT predicate on the "order" field.
|
||||
func OrderGT(v int) predicate.Task {
|
||||
return predicate.Task(sql.FieldGT(FieldOrder, v))
|
||||
}
|
||||
|
||||
// OrderGTE applies the GTE predicate on the "order" field.
|
||||
func OrderGTE(v int) predicate.Task {
|
||||
return predicate.Task(sql.FieldGTE(FieldOrder, v))
|
||||
}
|
||||
|
||||
// OrderLT applies the LT predicate on the "order" field.
|
||||
func OrderLT(v int) predicate.Task {
|
||||
return predicate.Task(sql.FieldLT(FieldOrder, v))
|
||||
}
|
||||
|
||||
// OrderLTE applies the LTE predicate on the "order" field.
|
||||
func OrderLTE(v int) predicate.Task {
|
||||
return predicate.Task(sql.FieldLTE(FieldOrder, v))
|
||||
}
|
||||
|
||||
// OrderIsNil applies the IsNil predicate on the "order" field.
|
||||
func OrderIsNil() predicate.Task {
|
||||
return predicate.Task(sql.FieldIsNull(FieldOrder))
|
||||
}
|
||||
|
||||
// OrderNotNil applies the NotNil predicate on the "order" field.
|
||||
func OrderNotNil() predicate.Task {
|
||||
return predicate.Task(sql.FieldNotNull(FieldOrder))
|
||||
}
|
||||
|
||||
// OrderOptionEQ applies the EQ predicate on the "order_option" field.
|
||||
func OrderOptionEQ(v int) predicate.Task {
|
||||
return predicate.Task(sql.FieldEQ(FieldOrderOption, v))
|
||||
}
|
||||
|
||||
// OrderOptionNEQ applies the NEQ predicate on the "order_option" field.
|
||||
func OrderOptionNEQ(v int) predicate.Task {
|
||||
return predicate.Task(sql.FieldNEQ(FieldOrderOption, v))
|
||||
}
|
||||
|
||||
// OrderOptionIn applies the In predicate on the "order_option" field.
|
||||
func OrderOptionIn(vs ...int) predicate.Task {
|
||||
return predicate.Task(sql.FieldIn(FieldOrderOption, vs...))
|
||||
}
|
||||
|
||||
// OrderOptionNotIn applies the NotIn predicate on the "order_option" field.
|
||||
func OrderOptionNotIn(vs ...int) predicate.Task {
|
||||
return predicate.Task(sql.FieldNotIn(FieldOrderOption, vs...))
|
||||
}
|
||||
|
||||
// OrderOptionGT applies the GT predicate on the "order_option" field.
|
||||
func OrderOptionGT(v int) predicate.Task {
|
||||
return predicate.Task(sql.FieldGT(FieldOrderOption, v))
|
||||
}
|
||||
|
||||
// OrderOptionGTE applies the GTE predicate on the "order_option" field.
|
||||
func OrderOptionGTE(v int) predicate.Task {
|
||||
return predicate.Task(sql.FieldGTE(FieldOrderOption, v))
|
||||
}
|
||||
|
||||
// OrderOptionLT applies the LT predicate on the "order_option" field.
|
||||
func OrderOptionLT(v int) predicate.Task {
|
||||
return predicate.Task(sql.FieldLT(FieldOrderOption, v))
|
||||
}
|
||||
|
||||
// OrderOptionLTE applies the LTE predicate on the "order_option" field.
|
||||
func OrderOptionLTE(v int) predicate.Task {
|
||||
return predicate.Task(sql.FieldLTE(FieldOrderOption, v))
|
||||
}
|
||||
|
||||
// OrderOptionIsNil applies the IsNil predicate on the "order_option" field.
|
||||
func OrderOptionIsNil() predicate.Task {
|
||||
return predicate.Task(sql.FieldIsNull(FieldOrderOption))
|
||||
}
|
||||
|
||||
// OrderOptionNotNil applies the NotNil predicate on the "order_option" field.
|
||||
func OrderOptionNotNil() predicate.Task {
|
||||
return predicate.Task(sql.FieldNotNull(FieldOrderOption))
|
||||
}
|
||||
|
||||
// OpEQ applies the EQ predicate on the "op" field.
|
||||
func OpEQ(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldEQ(FieldOp, v))
|
||||
}
|
||||
|
||||
// OpNEQ applies the NEQ predicate on the "op" field.
|
||||
func OpNEQ(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldNEQ(FieldOp, v))
|
||||
}
|
||||
|
||||
// OpIn applies the In predicate on the "op" field.
|
||||
func OpIn(vs ...string) predicate.Task {
|
||||
return predicate.Task(sql.FieldIn(FieldOp, vs...))
|
||||
}
|
||||
|
||||
// OpNotIn applies the NotIn predicate on the "op" field.
|
||||
func OpNotIn(vs ...string) predicate.Task {
|
||||
return predicate.Task(sql.FieldNotIn(FieldOp, vs...))
|
||||
}
|
||||
|
||||
// OpGT applies the GT predicate on the "op" field.
|
||||
func OpGT(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldGT(FieldOp, v))
|
||||
}
|
||||
|
||||
// OpGTE applies the GTE predicate on the "op" field.
|
||||
func OpGTE(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldGTE(FieldOp, v))
|
||||
}
|
||||
|
||||
// OpLT applies the LT predicate on the "op" field.
|
||||
func OpLT(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldLT(FieldOp, v))
|
||||
}
|
||||
|
||||
// OpLTE applies the LTE predicate on the "op" field.
|
||||
func OpLTE(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldLTE(FieldOp, v))
|
||||
}
|
||||
|
||||
// OpContains applies the Contains predicate on the "op" field.
|
||||
func OpContains(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldContains(FieldOp, v))
|
||||
}
|
||||
|
||||
// OpHasPrefix applies the HasPrefix predicate on the "op" field.
|
||||
func OpHasPrefix(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldHasPrefix(FieldOp, v))
|
||||
}
|
||||
|
||||
// OpHasSuffix applies the HasSuffix predicate on the "op" field.
|
||||
func OpHasSuffix(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldHasSuffix(FieldOp, v))
|
||||
}
|
||||
|
||||
// OpEqualFold applies the EqualFold predicate on the "op" field.
|
||||
func OpEqualFold(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldEqualFold(FieldOp, v))
|
||||
}
|
||||
|
||||
// OpContainsFold applies the ContainsFold predicate on the "op" field.
|
||||
func OpContainsFold(v string) predicate.Task {
|
||||
return predicate.Task(sql.FieldContainsFold(FieldOp, v))
|
||||
}
|
||||
|
||||
// And groups predicates with the AND operator between them.
|
||||
func And(predicates ...predicate.Task) predicate.Task {
|
||||
return predicate.Task(sql.AndPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Or groups predicates with the OR operator between them.
|
||||
func Or(predicates ...predicate.Task) predicate.Task {
|
||||
return predicate.Task(sql.OrPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Not applies the not operator on the given predicate.
|
||||
func Not(p predicate.Task) predicate.Task {
|
||||
return predicate.Task(sql.NotPredicates(p))
|
||||
}
|
||||
Reference in New Issue
Block a user