snapshot of https://github.com/ent/ent.git (master, 2026-09-15; blobs > 131072B omitted)
This commit is contained in:
35
entc/integration/gremlin/ent/comment/comment.go
Normal file
35
entc/integration/gremlin/ent/comment/comment.go
Normal file
@@ -0,0 +1,35 @@
|
||||
// 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 comment
|
||||
|
||||
import (
|
||||
"entgo.io/ent/dialect/gremlin/graph/dsl"
|
||||
)
|
||||
|
||||
const (
|
||||
// Label holds the string label denoting the comment type in the database.
|
||||
Label = "comment"
|
||||
// FieldID holds the string denoting the id field in the database.
|
||||
FieldID = "id"
|
||||
// FieldUniqueInt holds the string denoting the unique_int field in the database.
|
||||
FieldUniqueInt = "unique_int"
|
||||
// FieldUniqueFloat holds the string denoting the unique_float field in the database.
|
||||
FieldUniqueFloat = "unique_float"
|
||||
// FieldNillableInt holds the string denoting the nillable_int field in the database.
|
||||
FieldNillableInt = "nillable_int"
|
||||
// FieldTable holds the string denoting the table field in the database.
|
||||
FieldTable = "table"
|
||||
// FieldDir holds the string denoting the dir field in the database.
|
||||
FieldDir = "dir"
|
||||
// FieldClient holds the string denoting the client field in the database.
|
||||
FieldClient = "client"
|
||||
)
|
||||
|
||||
// OrderOption defines the ordering options for the Comment queries.
|
||||
type OrderOption func(*dsl.Traversal)
|
||||
|
||||
// comment from another template.
|
||||
591
entc/integration/gremlin/ent/comment/mutation.go
Normal file
591
entc/integration/gremlin/ent/comment/mutation.go
Normal file
@@ -0,0 +1,591 @@
|
||||
// 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 comment
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/dialect/gremlin/graph/dsl"
|
||||
schemadir "entgo.io/ent/entc/integration/ent/schema/dir"
|
||||
"entgo.io/ent/entc/integration/gremlin/ent/predicate"
|
||||
)
|
||||
|
||||
// Mutation represents an operation that mutates the Comment nodes in the graph.
|
||||
type Mutation struct {
|
||||
op ent.Op
|
||||
typ string
|
||||
unique_int *int
|
||||
addunique_int *int
|
||||
unique_float *float64
|
||||
addunique_float *float64
|
||||
nillable_int *int
|
||||
addnillable_int *int
|
||||
table *string
|
||||
dir *schemadir.Dir
|
||||
client *string
|
||||
clearedFields map[string]struct{}
|
||||
predicates []predicate.Comment
|
||||
}
|
||||
|
||||
// NewMutation creates a new Mutation for the Comment entity.
|
||||
func NewMutation(op ent.Op) *Mutation {
|
||||
return &Mutation{
|
||||
op: op,
|
||||
typ: "Comment",
|
||||
clearedFields: make(map[string]struct{}),
|
||||
}
|
||||
}
|
||||
|
||||
// Predicates returns the list of predicates set on the mutation.
|
||||
func (m *Mutation) Predicates() []predicate.Comment {
|
||||
return m.predicates
|
||||
}
|
||||
|
||||
// SetUniqueInt sets the "unique_int" field.
|
||||
func (m *Mutation) SetUniqueInt(i int) {
|
||||
m.unique_int = &i
|
||||
m.addunique_int = nil
|
||||
}
|
||||
|
||||
// UniqueInt returns the value of the "unique_int" field in the mutation.
|
||||
func (m *Mutation) UniqueInt() (r int, exists bool) {
|
||||
v := m.unique_int
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// AddUniqueInt adds i to the "unique_int" field.
|
||||
func (m *Mutation) AddUniqueInt(i int) {
|
||||
if m.addunique_int != nil {
|
||||
*m.addunique_int += i
|
||||
} else {
|
||||
m.addunique_int = &i
|
||||
}
|
||||
}
|
||||
|
||||
// AddedUniqueInt returns the value that was added to the "unique_int" field in this mutation.
|
||||
func (m *Mutation) AddedUniqueInt() (r int, exists bool) {
|
||||
v := m.addunique_int
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// ResetUniqueInt resets all changes to the "unique_int" field.
|
||||
func (m *Mutation) ResetUniqueInt() {
|
||||
m.unique_int = nil
|
||||
m.addunique_int = nil
|
||||
}
|
||||
|
||||
// SetUniqueFloat sets the "unique_float" field.
|
||||
func (m *Mutation) SetUniqueFloat(f float64) {
|
||||
m.unique_float = &f
|
||||
m.addunique_float = nil
|
||||
}
|
||||
|
||||
// UniqueFloat returns the value of the "unique_float" field in the mutation.
|
||||
func (m *Mutation) UniqueFloat() (r float64, exists bool) {
|
||||
v := m.unique_float
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// AddUniqueFloat adds f to the "unique_float" field.
|
||||
func (m *Mutation) AddUniqueFloat(f float64) {
|
||||
if m.addunique_float != nil {
|
||||
*m.addunique_float += f
|
||||
} else {
|
||||
m.addunique_float = &f
|
||||
}
|
||||
}
|
||||
|
||||
// AddedUniqueFloat returns the value that was added to the "unique_float" field in this mutation.
|
||||
func (m *Mutation) AddedUniqueFloat() (r float64, exists bool) {
|
||||
v := m.addunique_float
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// ResetUniqueFloat resets all changes to the "unique_float" field.
|
||||
func (m *Mutation) ResetUniqueFloat() {
|
||||
m.unique_float = nil
|
||||
m.addunique_float = nil
|
||||
}
|
||||
|
||||
// SetNillableInt sets the "nillable_int" field.
|
||||
func (m *Mutation) SetNillableInt(i int) {
|
||||
m.nillable_int = &i
|
||||
m.addnillable_int = nil
|
||||
}
|
||||
|
||||
// NillableInt returns the value of the "nillable_int" field in the mutation.
|
||||
func (m *Mutation) NillableInt() (r int, exists bool) {
|
||||
v := m.nillable_int
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// AddNillableInt adds i to the "nillable_int" field.
|
||||
func (m *Mutation) AddNillableInt(i int) {
|
||||
if m.addnillable_int != nil {
|
||||
*m.addnillable_int += i
|
||||
} else {
|
||||
m.addnillable_int = &i
|
||||
}
|
||||
}
|
||||
|
||||
// AddedNillableInt returns the value that was added to the "nillable_int" field in this mutation.
|
||||
func (m *Mutation) AddedNillableInt() (r int, exists bool) {
|
||||
v := m.addnillable_int
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// ClearNillableInt clears the value of the "nillable_int" field.
|
||||
func (m *Mutation) ClearNillableInt() {
|
||||
m.nillable_int = nil
|
||||
m.addnillable_int = nil
|
||||
m.clearedFields[FieldNillableInt] = struct{}{}
|
||||
}
|
||||
|
||||
// NillableIntCleared returns if the "nillable_int" field was cleared in this mutation.
|
||||
func (m *Mutation) NillableIntCleared() bool {
|
||||
_, ok := m.clearedFields[FieldNillableInt]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetNillableInt resets all changes to the "nillable_int" field.
|
||||
func (m *Mutation) ResetNillableInt() {
|
||||
m.nillable_int = nil
|
||||
m.addnillable_int = nil
|
||||
delete(m.clearedFields, FieldNillableInt)
|
||||
}
|
||||
|
||||
// SetTable sets the "table" field.
|
||||
func (m *Mutation) SetTable(s string) {
|
||||
m.table = &s
|
||||
}
|
||||
|
||||
// Table returns the value of the "table" field in the mutation.
|
||||
func (m *Mutation) Table() (r string, exists bool) {
|
||||
v := m.table
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// ClearTable clears the value of the "table" field.
|
||||
func (m *Mutation) ClearTable() {
|
||||
m.table = nil
|
||||
m.clearedFields[FieldTable] = struct{}{}
|
||||
}
|
||||
|
||||
// TableCleared returns if the "table" field was cleared in this mutation.
|
||||
func (m *Mutation) TableCleared() bool {
|
||||
_, ok := m.clearedFields[FieldTable]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetTable resets all changes to the "table" field.
|
||||
func (m *Mutation) ResetTable() {
|
||||
m.table = nil
|
||||
delete(m.clearedFields, FieldTable)
|
||||
}
|
||||
|
||||
// SetDir sets the "dir" field.
|
||||
func (m *Mutation) SetDir(s schemadir.Dir) {
|
||||
m.dir = &s
|
||||
}
|
||||
|
||||
// Dir returns the value of the "dir" field in the mutation.
|
||||
func (m *Mutation) Dir() (r schemadir.Dir, exists bool) {
|
||||
v := m.dir
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// ClearDir clears the value of the "dir" field.
|
||||
func (m *Mutation) ClearDir() {
|
||||
m.dir = nil
|
||||
m.clearedFields[FieldDir] = struct{}{}
|
||||
}
|
||||
|
||||
// DirCleared returns if the "dir" field was cleared in this mutation.
|
||||
func (m *Mutation) DirCleared() bool {
|
||||
_, ok := m.clearedFields[FieldDir]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetDir resets all changes to the "dir" field.
|
||||
func (m *Mutation) ResetDir() {
|
||||
m.dir = nil
|
||||
delete(m.clearedFields, FieldDir)
|
||||
}
|
||||
|
||||
// SetClient sets the "client" field.
|
||||
func (m *Mutation) SetClient(s string) {
|
||||
m.client = &s
|
||||
}
|
||||
|
||||
// GetClient returns the value of the "client" field in the mutation.
|
||||
func (m *Mutation) GetClient() (r string, exists bool) {
|
||||
v := m.client
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// ClearClient clears the value of the "client" field.
|
||||
func (m *Mutation) ClearClient() {
|
||||
m.client = nil
|
||||
m.clearedFields[FieldClient] = struct{}{}
|
||||
}
|
||||
|
||||
// ClientCleared returns if the "client" field was cleared in this mutation.
|
||||
func (m *Mutation) ClientCleared() bool {
|
||||
_, ok := m.clearedFields[FieldClient]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetClient resets all changes to the "client" field.
|
||||
func (m *Mutation) ResetClient() {
|
||||
m.client = nil
|
||||
delete(m.clearedFields, FieldClient)
|
||||
}
|
||||
|
||||
// Where appends a list predicates to the Mutation builder.
|
||||
func (m *Mutation) Where(ps ...predicate.Comment) {
|
||||
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(*dsl.Traversal)) {
|
||||
p := make([]predicate.Comment, 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 (Comment).
|
||||
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, 6)
|
||||
if m.unique_int != nil {
|
||||
fields = append(fields, FieldUniqueInt)
|
||||
}
|
||||
if m.unique_float != nil {
|
||||
fields = append(fields, FieldUniqueFloat)
|
||||
}
|
||||
if m.nillable_int != nil {
|
||||
fields = append(fields, FieldNillableInt)
|
||||
}
|
||||
if m.table != nil {
|
||||
fields = append(fields, FieldTable)
|
||||
}
|
||||
if m.dir != nil {
|
||||
fields = append(fields, FieldDir)
|
||||
}
|
||||
if m.client != nil {
|
||||
fields = append(fields, FieldClient)
|
||||
}
|
||||
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 FieldUniqueInt:
|
||||
return m.UniqueInt()
|
||||
case FieldUniqueFloat:
|
||||
return m.UniqueFloat()
|
||||
case FieldNillableInt:
|
||||
return m.NillableInt()
|
||||
case FieldTable:
|
||||
return m.Table()
|
||||
case FieldDir:
|
||||
return m.Dir()
|
||||
case FieldClient:
|
||||
return m.GetClient()
|
||||
}
|
||||
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 Comment 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 FieldUniqueInt:
|
||||
v, ok := value.(int)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetUniqueInt(v)
|
||||
return nil
|
||||
case FieldUniqueFloat:
|
||||
v, ok := value.(float64)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetUniqueFloat(v)
|
||||
return nil
|
||||
case FieldNillableInt:
|
||||
v, ok := value.(int)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetNillableInt(v)
|
||||
return nil
|
||||
case FieldTable:
|
||||
v, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetTable(v)
|
||||
return nil
|
||||
case FieldDir:
|
||||
v, ok := value.(schemadir.Dir)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetDir(v)
|
||||
return nil
|
||||
case FieldClient:
|
||||
v, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetClient(v)
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unknown Comment 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.addunique_int != nil {
|
||||
fields = append(fields, FieldUniqueInt)
|
||||
}
|
||||
if m.addunique_float != nil {
|
||||
fields = append(fields, FieldUniqueFloat)
|
||||
}
|
||||
if m.addnillable_int != nil {
|
||||
fields = append(fields, FieldNillableInt)
|
||||
}
|
||||
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 FieldUniqueInt:
|
||||
return m.AddedUniqueInt()
|
||||
case FieldUniqueFloat:
|
||||
return m.AddedUniqueFloat()
|
||||
case FieldNillableInt:
|
||||
return m.AddedNillableInt()
|
||||
}
|
||||
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 FieldUniqueInt:
|
||||
v, ok := value.(int)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.AddUniqueInt(v)
|
||||
return nil
|
||||
case FieldUniqueFloat:
|
||||
v, ok := value.(float64)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.AddUniqueFloat(v)
|
||||
return nil
|
||||
case FieldNillableInt:
|
||||
v, ok := value.(int)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.AddNillableInt(v)
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unknown Comment 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(FieldNillableInt) {
|
||||
fields = append(fields, FieldNillableInt)
|
||||
}
|
||||
if m.FieldCleared(FieldTable) {
|
||||
fields = append(fields, FieldTable)
|
||||
}
|
||||
if m.FieldCleared(FieldDir) {
|
||||
fields = append(fields, FieldDir)
|
||||
}
|
||||
if m.FieldCleared(FieldClient) {
|
||||
fields = append(fields, FieldClient)
|
||||
}
|
||||
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 FieldNillableInt:
|
||||
m.ClearNillableInt()
|
||||
return nil
|
||||
case FieldTable:
|
||||
m.ClearTable()
|
||||
return nil
|
||||
case FieldDir:
|
||||
m.ClearDir()
|
||||
return nil
|
||||
case FieldClient:
|
||||
m.ClearClient()
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unknown Comment 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 FieldUniqueInt:
|
||||
m.ResetUniqueInt()
|
||||
return nil
|
||||
case FieldUniqueFloat:
|
||||
m.ResetUniqueFloat()
|
||||
return nil
|
||||
case FieldNillableInt:
|
||||
m.ResetNillableInt()
|
||||
return nil
|
||||
case FieldTable:
|
||||
m.ResetTable()
|
||||
return nil
|
||||
case FieldDir:
|
||||
m.ResetDir()
|
||||
return nil
|
||||
case FieldClient:
|
||||
m.ResetClient()
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unknown Comment 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 Comment 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 Comment edge %s", name)
|
||||
}
|
||||
526
entc/integration/gremlin/ent/comment/where.go
Normal file
526
entc/integration/gremlin/ent/comment/where.go
Normal file
@@ -0,0 +1,526 @@
|
||||
// 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 comment
|
||||
|
||||
import (
|
||||
"entgo.io/ent/dialect/gremlin/graph/dsl"
|
||||
"entgo.io/ent/dialect/gremlin/graph/dsl/__"
|
||||
"entgo.io/ent/dialect/gremlin/graph/dsl/p"
|
||||
"entgo.io/ent/entc/integration/gremlin/ent/predicate"
|
||||
)
|
||||
|
||||
// ID filters vertices based on their ID field.
|
||||
func ID(id string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.HasID(id)
|
||||
})
|
||||
}
|
||||
|
||||
// IDEQ applies the EQ predicate on the ID field.
|
||||
func IDEQ(id string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.HasID(p.EQ(id))
|
||||
})
|
||||
}
|
||||
|
||||
// IDNEQ applies the NEQ predicate on the ID field.
|
||||
func IDNEQ(id string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.HasID(p.NEQ(id))
|
||||
})
|
||||
}
|
||||
|
||||
// IDIn applies the In predicate on the ID field.
|
||||
func IDIn(ids ...string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
v := make([]any, len(ids))
|
||||
for i := range v {
|
||||
v[i] = ids[i]
|
||||
}
|
||||
t.HasID(p.Within(v...))
|
||||
})
|
||||
}
|
||||
|
||||
// IDNotIn applies the NotIn predicate on the ID field.
|
||||
func IDNotIn(ids ...string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
v := make([]any, len(ids))
|
||||
for i := range v {
|
||||
v[i] = ids[i]
|
||||
}
|
||||
t.HasID(p.Without(v...))
|
||||
})
|
||||
}
|
||||
|
||||
// IDGT applies the GT predicate on the ID field.
|
||||
func IDGT(id string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.HasID(p.GT(id))
|
||||
})
|
||||
}
|
||||
|
||||
// IDGTE applies the GTE predicate on the ID field.
|
||||
func IDGTE(id string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.HasID(p.GTE(id))
|
||||
})
|
||||
}
|
||||
|
||||
// IDLT applies the LT predicate on the ID field.
|
||||
func IDLT(id string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.HasID(p.LT(id))
|
||||
})
|
||||
}
|
||||
|
||||
// IDLTE applies the LTE predicate on the ID field.
|
||||
func IDLTE(id string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.HasID(p.LTE(id))
|
||||
})
|
||||
}
|
||||
|
||||
// UniqueInt applies equality check predicate on the "unique_int" field. It's identical to UniqueIntEQ.
|
||||
func UniqueInt(v int) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldUniqueInt, p.EQ(v))
|
||||
})
|
||||
}
|
||||
|
||||
// UniqueFloat applies equality check predicate on the "unique_float" field. It's identical to UniqueFloatEQ.
|
||||
func UniqueFloat(v float64) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldUniqueFloat, p.EQ(v))
|
||||
})
|
||||
}
|
||||
|
||||
// NillableInt applies equality check predicate on the "nillable_int" field. It's identical to NillableIntEQ.
|
||||
func NillableInt(v int) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldNillableInt, p.EQ(v))
|
||||
})
|
||||
}
|
||||
|
||||
// Client applies equality check predicate on the "client" field. It's identical to ClientEQ.
|
||||
func Client(v string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldClient, p.EQ(v))
|
||||
})
|
||||
}
|
||||
|
||||
// UniqueIntEQ applies the EQ predicate on the "unique_int" field.
|
||||
func UniqueIntEQ(v int) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldUniqueInt, p.EQ(v))
|
||||
})
|
||||
}
|
||||
|
||||
// UniqueIntNEQ applies the NEQ predicate on the "unique_int" field.
|
||||
func UniqueIntNEQ(v int) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldUniqueInt, p.NEQ(v))
|
||||
})
|
||||
}
|
||||
|
||||
// UniqueIntIn applies the In predicate on the "unique_int" field.
|
||||
func UniqueIntIn(vs ...int) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldUniqueInt, p.Within(vs...))
|
||||
})
|
||||
}
|
||||
|
||||
// UniqueIntNotIn applies the NotIn predicate on the "unique_int" field.
|
||||
func UniqueIntNotIn(vs ...int) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldUniqueInt, p.Without(vs...))
|
||||
})
|
||||
}
|
||||
|
||||
// UniqueIntGT applies the GT predicate on the "unique_int" field.
|
||||
func UniqueIntGT(v int) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldUniqueInt, p.GT(v))
|
||||
})
|
||||
}
|
||||
|
||||
// UniqueIntGTE applies the GTE predicate on the "unique_int" field.
|
||||
func UniqueIntGTE(v int) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldUniqueInt, p.GTE(v))
|
||||
})
|
||||
}
|
||||
|
||||
// UniqueIntLT applies the LT predicate on the "unique_int" field.
|
||||
func UniqueIntLT(v int) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldUniqueInt, p.LT(v))
|
||||
})
|
||||
}
|
||||
|
||||
// UniqueIntLTE applies the LTE predicate on the "unique_int" field.
|
||||
func UniqueIntLTE(v int) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldUniqueInt, p.LTE(v))
|
||||
})
|
||||
}
|
||||
|
||||
// UniqueFloatEQ applies the EQ predicate on the "unique_float" field.
|
||||
func UniqueFloatEQ(v float64) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldUniqueFloat, p.EQ(v))
|
||||
})
|
||||
}
|
||||
|
||||
// UniqueFloatNEQ applies the NEQ predicate on the "unique_float" field.
|
||||
func UniqueFloatNEQ(v float64) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldUniqueFloat, p.NEQ(v))
|
||||
})
|
||||
}
|
||||
|
||||
// UniqueFloatIn applies the In predicate on the "unique_float" field.
|
||||
func UniqueFloatIn(vs ...float64) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldUniqueFloat, p.Within(vs...))
|
||||
})
|
||||
}
|
||||
|
||||
// UniqueFloatNotIn applies the NotIn predicate on the "unique_float" field.
|
||||
func UniqueFloatNotIn(vs ...float64) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldUniqueFloat, p.Without(vs...))
|
||||
})
|
||||
}
|
||||
|
||||
// UniqueFloatGT applies the GT predicate on the "unique_float" field.
|
||||
func UniqueFloatGT(v float64) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldUniqueFloat, p.GT(v))
|
||||
})
|
||||
}
|
||||
|
||||
// UniqueFloatGTE applies the GTE predicate on the "unique_float" field.
|
||||
func UniqueFloatGTE(v float64) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldUniqueFloat, p.GTE(v))
|
||||
})
|
||||
}
|
||||
|
||||
// UniqueFloatLT applies the LT predicate on the "unique_float" field.
|
||||
func UniqueFloatLT(v float64) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldUniqueFloat, p.LT(v))
|
||||
})
|
||||
}
|
||||
|
||||
// UniqueFloatLTE applies the LTE predicate on the "unique_float" field.
|
||||
func UniqueFloatLTE(v float64) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldUniqueFloat, p.LTE(v))
|
||||
})
|
||||
}
|
||||
|
||||
// NillableIntEQ applies the EQ predicate on the "nillable_int" field.
|
||||
func NillableIntEQ(v int) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldNillableInt, p.EQ(v))
|
||||
})
|
||||
}
|
||||
|
||||
// NillableIntNEQ applies the NEQ predicate on the "nillable_int" field.
|
||||
func NillableIntNEQ(v int) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldNillableInt, p.NEQ(v))
|
||||
})
|
||||
}
|
||||
|
||||
// NillableIntIn applies the In predicate on the "nillable_int" field.
|
||||
func NillableIntIn(vs ...int) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldNillableInt, p.Within(vs...))
|
||||
})
|
||||
}
|
||||
|
||||
// NillableIntNotIn applies the NotIn predicate on the "nillable_int" field.
|
||||
func NillableIntNotIn(vs ...int) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldNillableInt, p.Without(vs...))
|
||||
})
|
||||
}
|
||||
|
||||
// NillableIntGT applies the GT predicate on the "nillable_int" field.
|
||||
func NillableIntGT(v int) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldNillableInt, p.GT(v))
|
||||
})
|
||||
}
|
||||
|
||||
// NillableIntGTE applies the GTE predicate on the "nillable_int" field.
|
||||
func NillableIntGTE(v int) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldNillableInt, p.GTE(v))
|
||||
})
|
||||
}
|
||||
|
||||
// NillableIntLT applies the LT predicate on the "nillable_int" field.
|
||||
func NillableIntLT(v int) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldNillableInt, p.LT(v))
|
||||
})
|
||||
}
|
||||
|
||||
// NillableIntLTE applies the LTE predicate on the "nillable_int" field.
|
||||
func NillableIntLTE(v int) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldNillableInt, p.LTE(v))
|
||||
})
|
||||
}
|
||||
|
||||
// NillableIntIsNil applies the IsNil predicate on the "nillable_int" field.
|
||||
func NillableIntIsNil() predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.HasLabel(Label).HasNot(FieldNillableInt)
|
||||
})
|
||||
}
|
||||
|
||||
// NillableIntNotNil applies the NotNil predicate on the "nillable_int" field.
|
||||
func NillableIntNotNil() predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.HasLabel(Label).Has(FieldNillableInt)
|
||||
})
|
||||
}
|
||||
|
||||
// TableEQ applies the EQ predicate on the "table" field.
|
||||
func TableEQ(v string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldTable, p.EQ(v))
|
||||
})
|
||||
}
|
||||
|
||||
// TableNEQ applies the NEQ predicate on the "table" field.
|
||||
func TableNEQ(v string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldTable, p.NEQ(v))
|
||||
})
|
||||
}
|
||||
|
||||
// TableIn applies the In predicate on the "table" field.
|
||||
func TableIn(vs ...string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldTable, p.Within(vs...))
|
||||
})
|
||||
}
|
||||
|
||||
// TableNotIn applies the NotIn predicate on the "table" field.
|
||||
func TableNotIn(vs ...string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldTable, p.Without(vs...))
|
||||
})
|
||||
}
|
||||
|
||||
// TableGT applies the GT predicate on the "table" field.
|
||||
func TableGT(v string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldTable, p.GT(v))
|
||||
})
|
||||
}
|
||||
|
||||
// TableGTE applies the GTE predicate on the "table" field.
|
||||
func TableGTE(v string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldTable, p.GTE(v))
|
||||
})
|
||||
}
|
||||
|
||||
// TableLT applies the LT predicate on the "table" field.
|
||||
func TableLT(v string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldTable, p.LT(v))
|
||||
})
|
||||
}
|
||||
|
||||
// TableLTE applies the LTE predicate on the "table" field.
|
||||
func TableLTE(v string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldTable, p.LTE(v))
|
||||
})
|
||||
}
|
||||
|
||||
// TableContains applies the Contains predicate on the "table" field.
|
||||
func TableContains(v string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldTable, p.Containing(v))
|
||||
})
|
||||
}
|
||||
|
||||
// TableHasPrefix applies the HasPrefix predicate on the "table" field.
|
||||
func TableHasPrefix(v string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldTable, p.StartingWith(v))
|
||||
})
|
||||
}
|
||||
|
||||
// TableHasSuffix applies the HasSuffix predicate on the "table" field.
|
||||
func TableHasSuffix(v string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldTable, p.EndingWith(v))
|
||||
})
|
||||
}
|
||||
|
||||
// TableIsNil applies the IsNil predicate on the "table" field.
|
||||
func TableIsNil() predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.HasLabel(Label).HasNot(FieldTable)
|
||||
})
|
||||
}
|
||||
|
||||
// TableNotNil applies the NotNil predicate on the "table" field.
|
||||
func TableNotNil() predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.HasLabel(Label).Has(FieldTable)
|
||||
})
|
||||
}
|
||||
|
||||
// DirIsNil applies the IsNil predicate on the "dir" field.
|
||||
func DirIsNil() predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.HasLabel(Label).HasNot(FieldDir)
|
||||
})
|
||||
}
|
||||
|
||||
// DirNotNil applies the NotNil predicate on the "dir" field.
|
||||
func DirNotNil() predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.HasLabel(Label).Has(FieldDir)
|
||||
})
|
||||
}
|
||||
|
||||
// ClientEQ applies the EQ predicate on the "client" field.
|
||||
func ClientEQ(v string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldClient, p.EQ(v))
|
||||
})
|
||||
}
|
||||
|
||||
// ClientNEQ applies the NEQ predicate on the "client" field.
|
||||
func ClientNEQ(v string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldClient, p.NEQ(v))
|
||||
})
|
||||
}
|
||||
|
||||
// ClientIn applies the In predicate on the "client" field.
|
||||
func ClientIn(vs ...string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldClient, p.Within(vs...))
|
||||
})
|
||||
}
|
||||
|
||||
// ClientNotIn applies the NotIn predicate on the "client" field.
|
||||
func ClientNotIn(vs ...string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldClient, p.Without(vs...))
|
||||
})
|
||||
}
|
||||
|
||||
// ClientGT applies the GT predicate on the "client" field.
|
||||
func ClientGT(v string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldClient, p.GT(v))
|
||||
})
|
||||
}
|
||||
|
||||
// ClientGTE applies the GTE predicate on the "client" field.
|
||||
func ClientGTE(v string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldClient, p.GTE(v))
|
||||
})
|
||||
}
|
||||
|
||||
// ClientLT applies the LT predicate on the "client" field.
|
||||
func ClientLT(v string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldClient, p.LT(v))
|
||||
})
|
||||
}
|
||||
|
||||
// ClientLTE applies the LTE predicate on the "client" field.
|
||||
func ClientLTE(v string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldClient, p.LTE(v))
|
||||
})
|
||||
}
|
||||
|
||||
// ClientContains applies the Contains predicate on the "client" field.
|
||||
func ClientContains(v string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldClient, p.Containing(v))
|
||||
})
|
||||
}
|
||||
|
||||
// ClientHasPrefix applies the HasPrefix predicate on the "client" field.
|
||||
func ClientHasPrefix(v string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldClient, p.StartingWith(v))
|
||||
})
|
||||
}
|
||||
|
||||
// ClientHasSuffix applies the HasSuffix predicate on the "client" field.
|
||||
func ClientHasSuffix(v string) predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.Has(Label, FieldClient, p.EndingWith(v))
|
||||
})
|
||||
}
|
||||
|
||||
// ClientIsNil applies the IsNil predicate on the "client" field.
|
||||
func ClientIsNil() predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.HasLabel(Label).HasNot(FieldClient)
|
||||
})
|
||||
}
|
||||
|
||||
// ClientNotNil applies the NotNil predicate on the "client" field.
|
||||
func ClientNotNil() predicate.Comment {
|
||||
return predicate.Comment(func(t *dsl.Traversal) {
|
||||
t.HasLabel(Label).Has(FieldClient)
|
||||
})
|
||||
}
|
||||
|
||||
// And groups predicates with the AND operator between them.
|
||||
func And(predicates ...predicate.Comment) predicate.Comment {
|
||||
return predicate.Comment(func(tr *dsl.Traversal) {
|
||||
trs := make([]any, 0, len(predicates))
|
||||
for _, p := range predicates {
|
||||
t := __.New()
|
||||
p(t)
|
||||
trs = append(trs, t)
|
||||
}
|
||||
tr.Where(__.And(trs...))
|
||||
})
|
||||
}
|
||||
|
||||
// Or groups predicates with the OR operator between them.
|
||||
func Or(predicates ...predicate.Comment) predicate.Comment {
|
||||
return predicate.Comment(func(tr *dsl.Traversal) {
|
||||
trs := make([]any, 0, len(predicates))
|
||||
for _, p := range predicates {
|
||||
t := __.New()
|
||||
p(t)
|
||||
trs = append(trs, t)
|
||||
}
|
||||
tr.Where(__.Or(trs...))
|
||||
})
|
||||
}
|
||||
|
||||
// Not applies the not operator on the given predicate.
|
||||
func Not(p predicate.Comment) predicate.Comment {
|
||||
return predicate.Comment(func(tr *dsl.Traversal) {
|
||||
t := __.New()
|
||||
p(t)
|
||||
tr.Where(__.Not(t))
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user