From cbbbe6f4023dcb232ff61fb9fece5128c4223018 Mon Sep 17 00:00:00 2001 From: upstream-mirror Date: Wed, 16 Sep 2026 00:26:48 +0500 Subject: [PATCH] top-up: 5 source files 128-600 KB --- entc/integration/ent/fieldtype/where.go | 3815 +++++++++++ entc/integration/ent/fieldtype_create.go | 5874 +++++++++++++++++ entc/integration/ent/mutation.go | 4982 ++++++++++++++ .../gremlin/ent/fieldtype/where.go | 5108 ++++++++++++++ entc/integration/gremlin/ent/mutation.go | 4982 ++++++++++++++ 5 files changed, 24761 insertions(+) create mode 100644 entc/integration/ent/fieldtype/where.go create mode 100644 entc/integration/ent/fieldtype_create.go create mode 100644 entc/integration/ent/mutation.go create mode 100644 entc/integration/gremlin/ent/fieldtype/where.go create mode 100644 entc/integration/gremlin/ent/mutation.go diff --git a/entc/integration/ent/fieldtype/where.go b/entc/integration/ent/fieldtype/where.go new file mode 100644 index 0000000..939442c --- /dev/null +++ b/entc/integration/ent/fieldtype/where.go @@ -0,0 +1,3815 @@ +// 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 fieldtype + +import ( + "net" + "net/http" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/entc/integration/ent/predicate" + "entgo.io/ent/entc/integration/ent/role" + "entgo.io/ent/entc/integration/ent/schema" + "github.com/google/uuid" +) + +// ID filters vertices based on their ID field. +func ID(id int) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id int) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id int) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...int) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...int) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id int) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id int) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id int) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id int) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldID, id)) +} + +// Int applies equality check predicate on the "int" field. It's identical to IntEQ. +func Int(v int) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldInt, v)) +} + +// Int8 applies equality check predicate on the "int8" field. It's identical to Int8EQ. +func Int8(v int8) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldInt8, v)) +} + +// Int16 applies equality check predicate on the "int16" field. It's identical to Int16EQ. +func Int16(v int16) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldInt16, v)) +} + +// Int32 applies equality check predicate on the "int32" field. It's identical to Int32EQ. +func Int32(v int32) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldInt32, v)) +} + +// Int64 applies equality check predicate on the "int64" field. It's identical to Int64EQ. +func Int64(v int64) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldInt64, v)) +} + +// OptionalInt applies equality check predicate on the "optional_int" field. It's identical to OptionalIntEQ. +func OptionalInt(v int) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldOptionalInt, v)) +} + +// OptionalInt8 applies equality check predicate on the "optional_int8" field. It's identical to OptionalInt8EQ. +func OptionalInt8(v int8) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldOptionalInt8, v)) +} + +// OptionalInt16 applies equality check predicate on the "optional_int16" field. It's identical to OptionalInt16EQ. +func OptionalInt16(v int16) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldOptionalInt16, v)) +} + +// OptionalInt32 applies equality check predicate on the "optional_int32" field. It's identical to OptionalInt32EQ. +func OptionalInt32(v int32) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldOptionalInt32, v)) +} + +// OptionalInt64 applies equality check predicate on the "optional_int64" field. It's identical to OptionalInt64EQ. +func OptionalInt64(v int64) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldOptionalInt64, v)) +} + +// NillableInt applies equality check predicate on the "nillable_int" field. It's identical to NillableIntEQ. +func NillableInt(v int) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldNillableInt, v)) +} + +// NillableInt8 applies equality check predicate on the "nillable_int8" field. It's identical to NillableInt8EQ. +func NillableInt8(v int8) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldNillableInt8, v)) +} + +// NillableInt16 applies equality check predicate on the "nillable_int16" field. It's identical to NillableInt16EQ. +func NillableInt16(v int16) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldNillableInt16, v)) +} + +// NillableInt32 applies equality check predicate on the "nillable_int32" field. It's identical to NillableInt32EQ. +func NillableInt32(v int32) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldNillableInt32, v)) +} + +// NillableInt64 applies equality check predicate on the "nillable_int64" field. It's identical to NillableInt64EQ. +func NillableInt64(v int64) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldNillableInt64, v)) +} + +// ValidateOptionalInt32 applies equality check predicate on the "validate_optional_int32" field. It's identical to ValidateOptionalInt32EQ. +func ValidateOptionalInt32(v int32) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldValidateOptionalInt32, v)) +} + +// OptionalUint applies equality check predicate on the "optional_uint" field. It's identical to OptionalUintEQ. +func OptionalUint(v uint) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldOptionalUint, v)) +} + +// OptionalUint8 applies equality check predicate on the "optional_uint8" field. It's identical to OptionalUint8EQ. +func OptionalUint8(v uint8) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldOptionalUint8, v)) +} + +// OptionalUint16 applies equality check predicate on the "optional_uint16" field. It's identical to OptionalUint16EQ. +func OptionalUint16(v uint16) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldOptionalUint16, v)) +} + +// OptionalUint32 applies equality check predicate on the "optional_uint32" field. It's identical to OptionalUint32EQ. +func OptionalUint32(v uint32) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldOptionalUint32, v)) +} + +// OptionalUint64 applies equality check predicate on the "optional_uint64" field. It's identical to OptionalUint64EQ. +func OptionalUint64(v uint64) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldOptionalUint64, v)) +} + +// OptionalFloat applies equality check predicate on the "optional_float" field. It's identical to OptionalFloatEQ. +func OptionalFloat(v float64) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldOptionalFloat, v)) +} + +// OptionalFloat32 applies equality check predicate on the "optional_float32" field. It's identical to OptionalFloat32EQ. +func OptionalFloat32(v float32) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldOptionalFloat32, v)) +} + +// Text applies equality check predicate on the "text" field. It's identical to TextEQ. +func Text(v string) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldText, v)) +} + +// Datetime applies equality check predicate on the "datetime" field. It's identical to DatetimeEQ. +func Datetime(v time.Time) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldDatetime, v)) +} + +// Decimal applies equality check predicate on the "decimal" field. It's identical to DecimalEQ. +func Decimal(v float64) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldDecimal, v)) +} + +// LinkOther applies equality check predicate on the "link_other" field. It's identical to LinkOtherEQ. +func LinkOther(v *schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldLinkOther, v)) +} + +// LinkOtherFunc applies equality check predicate on the "link_other_func" field. It's identical to LinkOtherFuncEQ. +func LinkOtherFunc(v *schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldLinkOtherFunc, v)) +} + +// MAC applies equality check predicate on the "mac" field. It's identical to MACEQ. +func MAC(v schema.MAC) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldMAC, v)) +} + +// StringArray applies equality check predicate on the "string_array" field. It's identical to StringArrayEQ. +func StringArray(v schema.Strings) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldStringArray, v)) +} + +// Password applies equality check predicate on the "password" field. It's identical to PasswordEQ. +func Password(v string) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldPassword, v)) +} + +// StringScanner applies equality check predicate on the "string_scanner" field. It's identical to StringScannerEQ. +func StringScanner(v schema.StringScanner) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldStringScanner, v)) +} + +// Duration applies equality check predicate on the "duration" field. It's identical to DurationEQ. +func Duration(v time.Duration) predicate.FieldType { + vc := int64(v) + return predicate.FieldType(sql.FieldEQ(FieldDuration, vc)) +} + +// Dir applies equality check predicate on the "dir" field. It's identical to DirEQ. +func Dir(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldEQ(FieldDir, vc)) +} + +// Ndir applies equality check predicate on the "ndir" field. It's identical to NdirEQ. +func Ndir(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldEQ(FieldNdir, vc)) +} + +// Str applies equality check predicate on the "str" field. It's identical to StrEQ. +func Str(v sql.NullString) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldStr, v)) +} + +// NullStr applies equality check predicate on the "null_str" field. It's identical to NullStrEQ. +func NullStr(v *sql.NullString) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldNullStr, v)) +} + +// Link applies equality check predicate on the "link" field. It's identical to LinkEQ. +func Link(v schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldLink, v)) +} + +// NullLink applies equality check predicate on the "null_link" field. It's identical to NullLinkEQ. +func NullLink(v *schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldNullLink, v)) +} + +// Active applies equality check predicate on the "active" field. It's identical to ActiveEQ. +func Active(v schema.Status) predicate.FieldType { + vc := bool(v) + return predicate.FieldType(sql.FieldEQ(FieldActive, vc)) +} + +// NullActive applies equality check predicate on the "null_active" field. It's identical to NullActiveEQ. +func NullActive(v schema.Status) predicate.FieldType { + vc := bool(v) + return predicate.FieldType(sql.FieldEQ(FieldNullActive, vc)) +} + +// Deleted applies equality check predicate on the "deleted" field. It's identical to DeletedEQ. +func Deleted(v *sql.NullBool) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldDeleted, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v *sql.NullTime) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldDeletedAt, v)) +} + +// RawData applies equality check predicate on the "raw_data" field. It's identical to RawDataEQ. +func RawData(v []byte) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldRawData, v)) +} + +// Sensitive applies equality check predicate on the "sensitive" field. It's identical to SensitiveEQ. +func Sensitive(v []byte) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldSensitive, v)) +} + +// IP applies equality check predicate on the "ip" field. It's identical to IPEQ. +func IP(v net.IP) predicate.FieldType { + vc := []byte(v) + return predicate.FieldType(sql.FieldEQ(FieldIP, vc)) +} + +// NullInt64 applies equality check predicate on the "null_int64" field. It's identical to NullInt64EQ. +func NullInt64(v *sql.NullInt64) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldNullInt64, v)) +} + +// SchemaInt applies equality check predicate on the "schema_int" field. It's identical to SchemaIntEQ. +func SchemaInt(v schema.Int) predicate.FieldType { + vc := int(v) + return predicate.FieldType(sql.FieldEQ(FieldSchemaInt, vc)) +} + +// SchemaInt8 applies equality check predicate on the "schema_int8" field. It's identical to SchemaInt8EQ. +func SchemaInt8(v schema.Int8) predicate.FieldType { + vc := int8(v) + return predicate.FieldType(sql.FieldEQ(FieldSchemaInt8, vc)) +} + +// SchemaInt64 applies equality check predicate on the "schema_int64" field. It's identical to SchemaInt64EQ. +func SchemaInt64(v schema.Int64) predicate.FieldType { + vc := int64(v) + return predicate.FieldType(sql.FieldEQ(FieldSchemaInt64, vc)) +} + +// SchemaFloat applies equality check predicate on the "schema_float" field. It's identical to SchemaFloatEQ. +func SchemaFloat(v schema.Float64) predicate.FieldType { + vc := float64(v) + return predicate.FieldType(sql.FieldEQ(FieldSchemaFloat, vc)) +} + +// SchemaFloat32 applies equality check predicate on the "schema_float32" field. It's identical to SchemaFloat32EQ. +func SchemaFloat32(v schema.Float32) predicate.FieldType { + vc := float32(v) + return predicate.FieldType(sql.FieldEQ(FieldSchemaFloat32, vc)) +} + +// NullFloat applies equality check predicate on the "null_float" field. It's identical to NullFloatEQ. +func NullFloat(v *sql.NullFloat64) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldNullFloat, v)) +} + +// OptionalUUID applies equality check predicate on the "optional_uuid" field. It's identical to OptionalUUIDEQ. +func OptionalUUID(v uuid.UUID) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldOptionalUUID, v)) +} + +// NillableUUID applies equality check predicate on the "nillable_uuid" field. It's identical to NillableUUIDEQ. +func NillableUUID(v uuid.UUID) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldNillableUUID, v)) +} + +// Pair applies equality check predicate on the "pair" field. It's identical to PairEQ. +func Pair(v schema.Pair) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldPair, v)) +} + +// NilPair applies equality check predicate on the "nil_pair" field. It's identical to NilPairEQ. +func NilPair(v *schema.Pair) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldNilPair, v)) +} + +// Vstring applies equality check predicate on the "vstring" field. It's identical to VstringEQ. +func Vstring(v schema.VString) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldVstring, v)) +} + +// Triple applies equality check predicate on the "triple" field. It's identical to TripleEQ. +func Triple(v schema.Triple) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldTriple, v)) +} + +// BigInt applies equality check predicate on the "big_int" field. It's identical to BigIntEQ. +func BigInt(v schema.BigInt) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldBigInt, v)) +} + +// PasswordOther applies equality check predicate on the "password_other" field. It's identical to PasswordOtherEQ. +func PasswordOther(v schema.Password) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldPasswordOther, v)) +} + +// IntEQ applies the EQ predicate on the "int" field. +func IntEQ(v int) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldInt, v)) +} + +// IntNEQ applies the NEQ predicate on the "int" field. +func IntNEQ(v int) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldInt, v)) +} + +// IntIn applies the In predicate on the "int" field. +func IntIn(vs ...int) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldInt, vs...)) +} + +// IntNotIn applies the NotIn predicate on the "int" field. +func IntNotIn(vs ...int) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldInt, vs...)) +} + +// IntGT applies the GT predicate on the "int" field. +func IntGT(v int) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldInt, v)) +} + +// IntGTE applies the GTE predicate on the "int" field. +func IntGTE(v int) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldInt, v)) +} + +// IntLT applies the LT predicate on the "int" field. +func IntLT(v int) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldInt, v)) +} + +// IntLTE applies the LTE predicate on the "int" field. +func IntLTE(v int) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldInt, v)) +} + +// Int8EQ applies the EQ predicate on the "int8" field. +func Int8EQ(v int8) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldInt8, v)) +} + +// Int8NEQ applies the NEQ predicate on the "int8" field. +func Int8NEQ(v int8) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldInt8, v)) +} + +// Int8In applies the In predicate on the "int8" field. +func Int8In(vs ...int8) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldInt8, vs...)) +} + +// Int8NotIn applies the NotIn predicate on the "int8" field. +func Int8NotIn(vs ...int8) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldInt8, vs...)) +} + +// Int8GT applies the GT predicate on the "int8" field. +func Int8GT(v int8) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldInt8, v)) +} + +// Int8GTE applies the GTE predicate on the "int8" field. +func Int8GTE(v int8) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldInt8, v)) +} + +// Int8LT applies the LT predicate on the "int8" field. +func Int8LT(v int8) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldInt8, v)) +} + +// Int8LTE applies the LTE predicate on the "int8" field. +func Int8LTE(v int8) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldInt8, v)) +} + +// Int16EQ applies the EQ predicate on the "int16" field. +func Int16EQ(v int16) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldInt16, v)) +} + +// Int16NEQ applies the NEQ predicate on the "int16" field. +func Int16NEQ(v int16) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldInt16, v)) +} + +// Int16In applies the In predicate on the "int16" field. +func Int16In(vs ...int16) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldInt16, vs...)) +} + +// Int16NotIn applies the NotIn predicate on the "int16" field. +func Int16NotIn(vs ...int16) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldInt16, vs...)) +} + +// Int16GT applies the GT predicate on the "int16" field. +func Int16GT(v int16) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldInt16, v)) +} + +// Int16GTE applies the GTE predicate on the "int16" field. +func Int16GTE(v int16) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldInt16, v)) +} + +// Int16LT applies the LT predicate on the "int16" field. +func Int16LT(v int16) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldInt16, v)) +} + +// Int16LTE applies the LTE predicate on the "int16" field. +func Int16LTE(v int16) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldInt16, v)) +} + +// Int32EQ applies the EQ predicate on the "int32" field. +func Int32EQ(v int32) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldInt32, v)) +} + +// Int32NEQ applies the NEQ predicate on the "int32" field. +func Int32NEQ(v int32) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldInt32, v)) +} + +// Int32In applies the In predicate on the "int32" field. +func Int32In(vs ...int32) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldInt32, vs...)) +} + +// Int32NotIn applies the NotIn predicate on the "int32" field. +func Int32NotIn(vs ...int32) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldInt32, vs...)) +} + +// Int32GT applies the GT predicate on the "int32" field. +func Int32GT(v int32) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldInt32, v)) +} + +// Int32GTE applies the GTE predicate on the "int32" field. +func Int32GTE(v int32) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldInt32, v)) +} + +// Int32LT applies the LT predicate on the "int32" field. +func Int32LT(v int32) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldInt32, v)) +} + +// Int32LTE applies the LTE predicate on the "int32" field. +func Int32LTE(v int32) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldInt32, v)) +} + +// Int64EQ applies the EQ predicate on the "int64" field. +func Int64EQ(v int64) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldInt64, v)) +} + +// Int64NEQ applies the NEQ predicate on the "int64" field. +func Int64NEQ(v int64) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldInt64, v)) +} + +// Int64In applies the In predicate on the "int64" field. +func Int64In(vs ...int64) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldInt64, vs...)) +} + +// Int64NotIn applies the NotIn predicate on the "int64" field. +func Int64NotIn(vs ...int64) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldInt64, vs...)) +} + +// Int64GT applies the GT predicate on the "int64" field. +func Int64GT(v int64) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldInt64, v)) +} + +// Int64GTE applies the GTE predicate on the "int64" field. +func Int64GTE(v int64) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldInt64, v)) +} + +// Int64LT applies the LT predicate on the "int64" field. +func Int64LT(v int64) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldInt64, v)) +} + +// Int64LTE applies the LTE predicate on the "int64" field. +func Int64LTE(v int64) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldInt64, v)) +} + +// OptionalIntEQ applies the EQ predicate on the "optional_int" field. +func OptionalIntEQ(v int) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldOptionalInt, v)) +} + +// OptionalIntNEQ applies the NEQ predicate on the "optional_int" field. +func OptionalIntNEQ(v int) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldOptionalInt, v)) +} + +// OptionalIntIn applies the In predicate on the "optional_int" field. +func OptionalIntIn(vs ...int) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldOptionalInt, vs...)) +} + +// OptionalIntNotIn applies the NotIn predicate on the "optional_int" field. +func OptionalIntNotIn(vs ...int) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldOptionalInt, vs...)) +} + +// OptionalIntGT applies the GT predicate on the "optional_int" field. +func OptionalIntGT(v int) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldOptionalInt, v)) +} + +// OptionalIntGTE applies the GTE predicate on the "optional_int" field. +func OptionalIntGTE(v int) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldOptionalInt, v)) +} + +// OptionalIntLT applies the LT predicate on the "optional_int" field. +func OptionalIntLT(v int) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldOptionalInt, v)) +} + +// OptionalIntLTE applies the LTE predicate on the "optional_int" field. +func OptionalIntLTE(v int) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldOptionalInt, v)) +} + +// OptionalIntIsNil applies the IsNil predicate on the "optional_int" field. +func OptionalIntIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldOptionalInt)) +} + +// OptionalIntNotNil applies the NotNil predicate on the "optional_int" field. +func OptionalIntNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldOptionalInt)) +} + +// OptionalInt8EQ applies the EQ predicate on the "optional_int8" field. +func OptionalInt8EQ(v int8) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldOptionalInt8, v)) +} + +// OptionalInt8NEQ applies the NEQ predicate on the "optional_int8" field. +func OptionalInt8NEQ(v int8) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldOptionalInt8, v)) +} + +// OptionalInt8In applies the In predicate on the "optional_int8" field. +func OptionalInt8In(vs ...int8) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldOptionalInt8, vs...)) +} + +// OptionalInt8NotIn applies the NotIn predicate on the "optional_int8" field. +func OptionalInt8NotIn(vs ...int8) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldOptionalInt8, vs...)) +} + +// OptionalInt8GT applies the GT predicate on the "optional_int8" field. +func OptionalInt8GT(v int8) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldOptionalInt8, v)) +} + +// OptionalInt8GTE applies the GTE predicate on the "optional_int8" field. +func OptionalInt8GTE(v int8) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldOptionalInt8, v)) +} + +// OptionalInt8LT applies the LT predicate on the "optional_int8" field. +func OptionalInt8LT(v int8) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldOptionalInt8, v)) +} + +// OptionalInt8LTE applies the LTE predicate on the "optional_int8" field. +func OptionalInt8LTE(v int8) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldOptionalInt8, v)) +} + +// OptionalInt8IsNil applies the IsNil predicate on the "optional_int8" field. +func OptionalInt8IsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldOptionalInt8)) +} + +// OptionalInt8NotNil applies the NotNil predicate on the "optional_int8" field. +func OptionalInt8NotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldOptionalInt8)) +} + +// OptionalInt16EQ applies the EQ predicate on the "optional_int16" field. +func OptionalInt16EQ(v int16) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldOptionalInt16, v)) +} + +// OptionalInt16NEQ applies the NEQ predicate on the "optional_int16" field. +func OptionalInt16NEQ(v int16) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldOptionalInt16, v)) +} + +// OptionalInt16In applies the In predicate on the "optional_int16" field. +func OptionalInt16In(vs ...int16) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldOptionalInt16, vs...)) +} + +// OptionalInt16NotIn applies the NotIn predicate on the "optional_int16" field. +func OptionalInt16NotIn(vs ...int16) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldOptionalInt16, vs...)) +} + +// OptionalInt16GT applies the GT predicate on the "optional_int16" field. +func OptionalInt16GT(v int16) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldOptionalInt16, v)) +} + +// OptionalInt16GTE applies the GTE predicate on the "optional_int16" field. +func OptionalInt16GTE(v int16) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldOptionalInt16, v)) +} + +// OptionalInt16LT applies the LT predicate on the "optional_int16" field. +func OptionalInt16LT(v int16) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldOptionalInt16, v)) +} + +// OptionalInt16LTE applies the LTE predicate on the "optional_int16" field. +func OptionalInt16LTE(v int16) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldOptionalInt16, v)) +} + +// OptionalInt16IsNil applies the IsNil predicate on the "optional_int16" field. +func OptionalInt16IsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldOptionalInt16)) +} + +// OptionalInt16NotNil applies the NotNil predicate on the "optional_int16" field. +func OptionalInt16NotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldOptionalInt16)) +} + +// OptionalInt32EQ applies the EQ predicate on the "optional_int32" field. +func OptionalInt32EQ(v int32) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldOptionalInt32, v)) +} + +// OptionalInt32NEQ applies the NEQ predicate on the "optional_int32" field. +func OptionalInt32NEQ(v int32) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldOptionalInt32, v)) +} + +// OptionalInt32In applies the In predicate on the "optional_int32" field. +func OptionalInt32In(vs ...int32) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldOptionalInt32, vs...)) +} + +// OptionalInt32NotIn applies the NotIn predicate on the "optional_int32" field. +func OptionalInt32NotIn(vs ...int32) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldOptionalInt32, vs...)) +} + +// OptionalInt32GT applies the GT predicate on the "optional_int32" field. +func OptionalInt32GT(v int32) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldOptionalInt32, v)) +} + +// OptionalInt32GTE applies the GTE predicate on the "optional_int32" field. +func OptionalInt32GTE(v int32) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldOptionalInt32, v)) +} + +// OptionalInt32LT applies the LT predicate on the "optional_int32" field. +func OptionalInt32LT(v int32) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldOptionalInt32, v)) +} + +// OptionalInt32LTE applies the LTE predicate on the "optional_int32" field. +func OptionalInt32LTE(v int32) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldOptionalInt32, v)) +} + +// OptionalInt32IsNil applies the IsNil predicate on the "optional_int32" field. +func OptionalInt32IsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldOptionalInt32)) +} + +// OptionalInt32NotNil applies the NotNil predicate on the "optional_int32" field. +func OptionalInt32NotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldOptionalInt32)) +} + +// OptionalInt64EQ applies the EQ predicate on the "optional_int64" field. +func OptionalInt64EQ(v int64) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldOptionalInt64, v)) +} + +// OptionalInt64NEQ applies the NEQ predicate on the "optional_int64" field. +func OptionalInt64NEQ(v int64) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldOptionalInt64, v)) +} + +// OptionalInt64In applies the In predicate on the "optional_int64" field. +func OptionalInt64In(vs ...int64) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldOptionalInt64, vs...)) +} + +// OptionalInt64NotIn applies the NotIn predicate on the "optional_int64" field. +func OptionalInt64NotIn(vs ...int64) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldOptionalInt64, vs...)) +} + +// OptionalInt64GT applies the GT predicate on the "optional_int64" field. +func OptionalInt64GT(v int64) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldOptionalInt64, v)) +} + +// OptionalInt64GTE applies the GTE predicate on the "optional_int64" field. +func OptionalInt64GTE(v int64) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldOptionalInt64, v)) +} + +// OptionalInt64LT applies the LT predicate on the "optional_int64" field. +func OptionalInt64LT(v int64) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldOptionalInt64, v)) +} + +// OptionalInt64LTE applies the LTE predicate on the "optional_int64" field. +func OptionalInt64LTE(v int64) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldOptionalInt64, v)) +} + +// OptionalInt64IsNil applies the IsNil predicate on the "optional_int64" field. +func OptionalInt64IsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldOptionalInt64)) +} + +// OptionalInt64NotNil applies the NotNil predicate on the "optional_int64" field. +func OptionalInt64NotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldOptionalInt64)) +} + +// NillableIntEQ applies the EQ predicate on the "nillable_int" field. +func NillableIntEQ(v int) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldNillableInt, v)) +} + +// NillableIntNEQ applies the NEQ predicate on the "nillable_int" field. +func NillableIntNEQ(v int) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldNillableInt, v)) +} + +// NillableIntIn applies the In predicate on the "nillable_int" field. +func NillableIntIn(vs ...int) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldNillableInt, vs...)) +} + +// NillableIntNotIn applies the NotIn predicate on the "nillable_int" field. +func NillableIntNotIn(vs ...int) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldNillableInt, vs...)) +} + +// NillableIntGT applies the GT predicate on the "nillable_int" field. +func NillableIntGT(v int) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldNillableInt, v)) +} + +// NillableIntGTE applies the GTE predicate on the "nillable_int" field. +func NillableIntGTE(v int) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldNillableInt, v)) +} + +// NillableIntLT applies the LT predicate on the "nillable_int" field. +func NillableIntLT(v int) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldNillableInt, v)) +} + +// NillableIntLTE applies the LTE predicate on the "nillable_int" field. +func NillableIntLTE(v int) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldNillableInt, v)) +} + +// NillableIntIsNil applies the IsNil predicate on the "nillable_int" field. +func NillableIntIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldNillableInt)) +} + +// NillableIntNotNil applies the NotNil predicate on the "nillable_int" field. +func NillableIntNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldNillableInt)) +} + +// NillableInt8EQ applies the EQ predicate on the "nillable_int8" field. +func NillableInt8EQ(v int8) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldNillableInt8, v)) +} + +// NillableInt8NEQ applies the NEQ predicate on the "nillable_int8" field. +func NillableInt8NEQ(v int8) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldNillableInt8, v)) +} + +// NillableInt8In applies the In predicate on the "nillable_int8" field. +func NillableInt8In(vs ...int8) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldNillableInt8, vs...)) +} + +// NillableInt8NotIn applies the NotIn predicate on the "nillable_int8" field. +func NillableInt8NotIn(vs ...int8) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldNillableInt8, vs...)) +} + +// NillableInt8GT applies the GT predicate on the "nillable_int8" field. +func NillableInt8GT(v int8) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldNillableInt8, v)) +} + +// NillableInt8GTE applies the GTE predicate on the "nillable_int8" field. +func NillableInt8GTE(v int8) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldNillableInt8, v)) +} + +// NillableInt8LT applies the LT predicate on the "nillable_int8" field. +func NillableInt8LT(v int8) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldNillableInt8, v)) +} + +// NillableInt8LTE applies the LTE predicate on the "nillable_int8" field. +func NillableInt8LTE(v int8) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldNillableInt8, v)) +} + +// NillableInt8IsNil applies the IsNil predicate on the "nillable_int8" field. +func NillableInt8IsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldNillableInt8)) +} + +// NillableInt8NotNil applies the NotNil predicate on the "nillable_int8" field. +func NillableInt8NotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldNillableInt8)) +} + +// NillableInt16EQ applies the EQ predicate on the "nillable_int16" field. +func NillableInt16EQ(v int16) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldNillableInt16, v)) +} + +// NillableInt16NEQ applies the NEQ predicate on the "nillable_int16" field. +func NillableInt16NEQ(v int16) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldNillableInt16, v)) +} + +// NillableInt16In applies the In predicate on the "nillable_int16" field. +func NillableInt16In(vs ...int16) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldNillableInt16, vs...)) +} + +// NillableInt16NotIn applies the NotIn predicate on the "nillable_int16" field. +func NillableInt16NotIn(vs ...int16) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldNillableInt16, vs...)) +} + +// NillableInt16GT applies the GT predicate on the "nillable_int16" field. +func NillableInt16GT(v int16) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldNillableInt16, v)) +} + +// NillableInt16GTE applies the GTE predicate on the "nillable_int16" field. +func NillableInt16GTE(v int16) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldNillableInt16, v)) +} + +// NillableInt16LT applies the LT predicate on the "nillable_int16" field. +func NillableInt16LT(v int16) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldNillableInt16, v)) +} + +// NillableInt16LTE applies the LTE predicate on the "nillable_int16" field. +func NillableInt16LTE(v int16) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldNillableInt16, v)) +} + +// NillableInt16IsNil applies the IsNil predicate on the "nillable_int16" field. +func NillableInt16IsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldNillableInt16)) +} + +// NillableInt16NotNil applies the NotNil predicate on the "nillable_int16" field. +func NillableInt16NotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldNillableInt16)) +} + +// NillableInt32EQ applies the EQ predicate on the "nillable_int32" field. +func NillableInt32EQ(v int32) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldNillableInt32, v)) +} + +// NillableInt32NEQ applies the NEQ predicate on the "nillable_int32" field. +func NillableInt32NEQ(v int32) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldNillableInt32, v)) +} + +// NillableInt32In applies the In predicate on the "nillable_int32" field. +func NillableInt32In(vs ...int32) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldNillableInt32, vs...)) +} + +// NillableInt32NotIn applies the NotIn predicate on the "nillable_int32" field. +func NillableInt32NotIn(vs ...int32) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldNillableInt32, vs...)) +} + +// NillableInt32GT applies the GT predicate on the "nillable_int32" field. +func NillableInt32GT(v int32) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldNillableInt32, v)) +} + +// NillableInt32GTE applies the GTE predicate on the "nillable_int32" field. +func NillableInt32GTE(v int32) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldNillableInt32, v)) +} + +// NillableInt32LT applies the LT predicate on the "nillable_int32" field. +func NillableInt32LT(v int32) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldNillableInt32, v)) +} + +// NillableInt32LTE applies the LTE predicate on the "nillable_int32" field. +func NillableInt32LTE(v int32) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldNillableInt32, v)) +} + +// NillableInt32IsNil applies the IsNil predicate on the "nillable_int32" field. +func NillableInt32IsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldNillableInt32)) +} + +// NillableInt32NotNil applies the NotNil predicate on the "nillable_int32" field. +func NillableInt32NotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldNillableInt32)) +} + +// NillableInt64EQ applies the EQ predicate on the "nillable_int64" field. +func NillableInt64EQ(v int64) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldNillableInt64, v)) +} + +// NillableInt64NEQ applies the NEQ predicate on the "nillable_int64" field. +func NillableInt64NEQ(v int64) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldNillableInt64, v)) +} + +// NillableInt64In applies the In predicate on the "nillable_int64" field. +func NillableInt64In(vs ...int64) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldNillableInt64, vs...)) +} + +// NillableInt64NotIn applies the NotIn predicate on the "nillable_int64" field. +func NillableInt64NotIn(vs ...int64) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldNillableInt64, vs...)) +} + +// NillableInt64GT applies the GT predicate on the "nillable_int64" field. +func NillableInt64GT(v int64) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldNillableInt64, v)) +} + +// NillableInt64GTE applies the GTE predicate on the "nillable_int64" field. +func NillableInt64GTE(v int64) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldNillableInt64, v)) +} + +// NillableInt64LT applies the LT predicate on the "nillable_int64" field. +func NillableInt64LT(v int64) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldNillableInt64, v)) +} + +// NillableInt64LTE applies the LTE predicate on the "nillable_int64" field. +func NillableInt64LTE(v int64) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldNillableInt64, v)) +} + +// NillableInt64IsNil applies the IsNil predicate on the "nillable_int64" field. +func NillableInt64IsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldNillableInt64)) +} + +// NillableInt64NotNil applies the NotNil predicate on the "nillable_int64" field. +func NillableInt64NotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldNillableInt64)) +} + +// ValidateOptionalInt32EQ applies the EQ predicate on the "validate_optional_int32" field. +func ValidateOptionalInt32EQ(v int32) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldValidateOptionalInt32, v)) +} + +// ValidateOptionalInt32NEQ applies the NEQ predicate on the "validate_optional_int32" field. +func ValidateOptionalInt32NEQ(v int32) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldValidateOptionalInt32, v)) +} + +// ValidateOptionalInt32In applies the In predicate on the "validate_optional_int32" field. +func ValidateOptionalInt32In(vs ...int32) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldValidateOptionalInt32, vs...)) +} + +// ValidateOptionalInt32NotIn applies the NotIn predicate on the "validate_optional_int32" field. +func ValidateOptionalInt32NotIn(vs ...int32) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldValidateOptionalInt32, vs...)) +} + +// ValidateOptionalInt32GT applies the GT predicate on the "validate_optional_int32" field. +func ValidateOptionalInt32GT(v int32) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldValidateOptionalInt32, v)) +} + +// ValidateOptionalInt32GTE applies the GTE predicate on the "validate_optional_int32" field. +func ValidateOptionalInt32GTE(v int32) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldValidateOptionalInt32, v)) +} + +// ValidateOptionalInt32LT applies the LT predicate on the "validate_optional_int32" field. +func ValidateOptionalInt32LT(v int32) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldValidateOptionalInt32, v)) +} + +// ValidateOptionalInt32LTE applies the LTE predicate on the "validate_optional_int32" field. +func ValidateOptionalInt32LTE(v int32) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldValidateOptionalInt32, v)) +} + +// ValidateOptionalInt32IsNil applies the IsNil predicate on the "validate_optional_int32" field. +func ValidateOptionalInt32IsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldValidateOptionalInt32)) +} + +// ValidateOptionalInt32NotNil applies the NotNil predicate on the "validate_optional_int32" field. +func ValidateOptionalInt32NotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldValidateOptionalInt32)) +} + +// OptionalUintEQ applies the EQ predicate on the "optional_uint" field. +func OptionalUintEQ(v uint) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldOptionalUint, v)) +} + +// OptionalUintNEQ applies the NEQ predicate on the "optional_uint" field. +func OptionalUintNEQ(v uint) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldOptionalUint, v)) +} + +// OptionalUintIn applies the In predicate on the "optional_uint" field. +func OptionalUintIn(vs ...uint) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldOptionalUint, vs...)) +} + +// OptionalUintNotIn applies the NotIn predicate on the "optional_uint" field. +func OptionalUintNotIn(vs ...uint) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldOptionalUint, vs...)) +} + +// OptionalUintGT applies the GT predicate on the "optional_uint" field. +func OptionalUintGT(v uint) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldOptionalUint, v)) +} + +// OptionalUintGTE applies the GTE predicate on the "optional_uint" field. +func OptionalUintGTE(v uint) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldOptionalUint, v)) +} + +// OptionalUintLT applies the LT predicate on the "optional_uint" field. +func OptionalUintLT(v uint) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldOptionalUint, v)) +} + +// OptionalUintLTE applies the LTE predicate on the "optional_uint" field. +func OptionalUintLTE(v uint) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldOptionalUint, v)) +} + +// OptionalUintIsNil applies the IsNil predicate on the "optional_uint" field. +func OptionalUintIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldOptionalUint)) +} + +// OptionalUintNotNil applies the NotNil predicate on the "optional_uint" field. +func OptionalUintNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldOptionalUint)) +} + +// OptionalUint8EQ applies the EQ predicate on the "optional_uint8" field. +func OptionalUint8EQ(v uint8) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldOptionalUint8, v)) +} + +// OptionalUint8NEQ applies the NEQ predicate on the "optional_uint8" field. +func OptionalUint8NEQ(v uint8) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldOptionalUint8, v)) +} + +// OptionalUint8In applies the In predicate on the "optional_uint8" field. +func OptionalUint8In(vs ...uint8) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldOptionalUint8, vs...)) +} + +// OptionalUint8NotIn applies the NotIn predicate on the "optional_uint8" field. +func OptionalUint8NotIn(vs ...uint8) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldOptionalUint8, vs...)) +} + +// OptionalUint8GT applies the GT predicate on the "optional_uint8" field. +func OptionalUint8GT(v uint8) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldOptionalUint8, v)) +} + +// OptionalUint8GTE applies the GTE predicate on the "optional_uint8" field. +func OptionalUint8GTE(v uint8) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldOptionalUint8, v)) +} + +// OptionalUint8LT applies the LT predicate on the "optional_uint8" field. +func OptionalUint8LT(v uint8) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldOptionalUint8, v)) +} + +// OptionalUint8LTE applies the LTE predicate on the "optional_uint8" field. +func OptionalUint8LTE(v uint8) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldOptionalUint8, v)) +} + +// OptionalUint8IsNil applies the IsNil predicate on the "optional_uint8" field. +func OptionalUint8IsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldOptionalUint8)) +} + +// OptionalUint8NotNil applies the NotNil predicate on the "optional_uint8" field. +func OptionalUint8NotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldOptionalUint8)) +} + +// OptionalUint16EQ applies the EQ predicate on the "optional_uint16" field. +func OptionalUint16EQ(v uint16) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldOptionalUint16, v)) +} + +// OptionalUint16NEQ applies the NEQ predicate on the "optional_uint16" field. +func OptionalUint16NEQ(v uint16) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldOptionalUint16, v)) +} + +// OptionalUint16In applies the In predicate on the "optional_uint16" field. +func OptionalUint16In(vs ...uint16) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldOptionalUint16, vs...)) +} + +// OptionalUint16NotIn applies the NotIn predicate on the "optional_uint16" field. +func OptionalUint16NotIn(vs ...uint16) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldOptionalUint16, vs...)) +} + +// OptionalUint16GT applies the GT predicate on the "optional_uint16" field. +func OptionalUint16GT(v uint16) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldOptionalUint16, v)) +} + +// OptionalUint16GTE applies the GTE predicate on the "optional_uint16" field. +func OptionalUint16GTE(v uint16) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldOptionalUint16, v)) +} + +// OptionalUint16LT applies the LT predicate on the "optional_uint16" field. +func OptionalUint16LT(v uint16) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldOptionalUint16, v)) +} + +// OptionalUint16LTE applies the LTE predicate on the "optional_uint16" field. +func OptionalUint16LTE(v uint16) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldOptionalUint16, v)) +} + +// OptionalUint16IsNil applies the IsNil predicate on the "optional_uint16" field. +func OptionalUint16IsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldOptionalUint16)) +} + +// OptionalUint16NotNil applies the NotNil predicate on the "optional_uint16" field. +func OptionalUint16NotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldOptionalUint16)) +} + +// OptionalUint32EQ applies the EQ predicate on the "optional_uint32" field. +func OptionalUint32EQ(v uint32) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldOptionalUint32, v)) +} + +// OptionalUint32NEQ applies the NEQ predicate on the "optional_uint32" field. +func OptionalUint32NEQ(v uint32) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldOptionalUint32, v)) +} + +// OptionalUint32In applies the In predicate on the "optional_uint32" field. +func OptionalUint32In(vs ...uint32) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldOptionalUint32, vs...)) +} + +// OptionalUint32NotIn applies the NotIn predicate on the "optional_uint32" field. +func OptionalUint32NotIn(vs ...uint32) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldOptionalUint32, vs...)) +} + +// OptionalUint32GT applies the GT predicate on the "optional_uint32" field. +func OptionalUint32GT(v uint32) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldOptionalUint32, v)) +} + +// OptionalUint32GTE applies the GTE predicate on the "optional_uint32" field. +func OptionalUint32GTE(v uint32) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldOptionalUint32, v)) +} + +// OptionalUint32LT applies the LT predicate on the "optional_uint32" field. +func OptionalUint32LT(v uint32) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldOptionalUint32, v)) +} + +// OptionalUint32LTE applies the LTE predicate on the "optional_uint32" field. +func OptionalUint32LTE(v uint32) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldOptionalUint32, v)) +} + +// OptionalUint32IsNil applies the IsNil predicate on the "optional_uint32" field. +func OptionalUint32IsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldOptionalUint32)) +} + +// OptionalUint32NotNil applies the NotNil predicate on the "optional_uint32" field. +func OptionalUint32NotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldOptionalUint32)) +} + +// OptionalUint64EQ applies the EQ predicate on the "optional_uint64" field. +func OptionalUint64EQ(v uint64) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldOptionalUint64, v)) +} + +// OptionalUint64NEQ applies the NEQ predicate on the "optional_uint64" field. +func OptionalUint64NEQ(v uint64) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldOptionalUint64, v)) +} + +// OptionalUint64In applies the In predicate on the "optional_uint64" field. +func OptionalUint64In(vs ...uint64) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldOptionalUint64, vs...)) +} + +// OptionalUint64NotIn applies the NotIn predicate on the "optional_uint64" field. +func OptionalUint64NotIn(vs ...uint64) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldOptionalUint64, vs...)) +} + +// OptionalUint64GT applies the GT predicate on the "optional_uint64" field. +func OptionalUint64GT(v uint64) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldOptionalUint64, v)) +} + +// OptionalUint64GTE applies the GTE predicate on the "optional_uint64" field. +func OptionalUint64GTE(v uint64) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldOptionalUint64, v)) +} + +// OptionalUint64LT applies the LT predicate on the "optional_uint64" field. +func OptionalUint64LT(v uint64) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldOptionalUint64, v)) +} + +// OptionalUint64LTE applies the LTE predicate on the "optional_uint64" field. +func OptionalUint64LTE(v uint64) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldOptionalUint64, v)) +} + +// OptionalUint64IsNil applies the IsNil predicate on the "optional_uint64" field. +func OptionalUint64IsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldOptionalUint64)) +} + +// OptionalUint64NotNil applies the NotNil predicate on the "optional_uint64" field. +func OptionalUint64NotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldOptionalUint64)) +} + +// StateEQ applies the EQ predicate on the "state" field. +func StateEQ(v State) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldState, v)) +} + +// StateNEQ applies the NEQ predicate on the "state" field. +func StateNEQ(v State) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldState, v)) +} + +// StateIn applies the In predicate on the "state" field. +func StateIn(vs ...State) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldState, vs...)) +} + +// StateNotIn applies the NotIn predicate on the "state" field. +func StateNotIn(vs ...State) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldState, vs...)) +} + +// StateIsNil applies the IsNil predicate on the "state" field. +func StateIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldState)) +} + +// StateNotNil applies the NotNil predicate on the "state" field. +func StateNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldState)) +} + +// OptionalFloatEQ applies the EQ predicate on the "optional_float" field. +func OptionalFloatEQ(v float64) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldOptionalFloat, v)) +} + +// OptionalFloatNEQ applies the NEQ predicate on the "optional_float" field. +func OptionalFloatNEQ(v float64) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldOptionalFloat, v)) +} + +// OptionalFloatIn applies the In predicate on the "optional_float" field. +func OptionalFloatIn(vs ...float64) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldOptionalFloat, vs...)) +} + +// OptionalFloatNotIn applies the NotIn predicate on the "optional_float" field. +func OptionalFloatNotIn(vs ...float64) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldOptionalFloat, vs...)) +} + +// OptionalFloatGT applies the GT predicate on the "optional_float" field. +func OptionalFloatGT(v float64) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldOptionalFloat, v)) +} + +// OptionalFloatGTE applies the GTE predicate on the "optional_float" field. +func OptionalFloatGTE(v float64) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldOptionalFloat, v)) +} + +// OptionalFloatLT applies the LT predicate on the "optional_float" field. +func OptionalFloatLT(v float64) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldOptionalFloat, v)) +} + +// OptionalFloatLTE applies the LTE predicate on the "optional_float" field. +func OptionalFloatLTE(v float64) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldOptionalFloat, v)) +} + +// OptionalFloatIsNil applies the IsNil predicate on the "optional_float" field. +func OptionalFloatIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldOptionalFloat)) +} + +// OptionalFloatNotNil applies the NotNil predicate on the "optional_float" field. +func OptionalFloatNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldOptionalFloat)) +} + +// OptionalFloat32EQ applies the EQ predicate on the "optional_float32" field. +func OptionalFloat32EQ(v float32) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldOptionalFloat32, v)) +} + +// OptionalFloat32NEQ applies the NEQ predicate on the "optional_float32" field. +func OptionalFloat32NEQ(v float32) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldOptionalFloat32, v)) +} + +// OptionalFloat32In applies the In predicate on the "optional_float32" field. +func OptionalFloat32In(vs ...float32) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldOptionalFloat32, vs...)) +} + +// OptionalFloat32NotIn applies the NotIn predicate on the "optional_float32" field. +func OptionalFloat32NotIn(vs ...float32) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldOptionalFloat32, vs...)) +} + +// OptionalFloat32GT applies the GT predicate on the "optional_float32" field. +func OptionalFloat32GT(v float32) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldOptionalFloat32, v)) +} + +// OptionalFloat32GTE applies the GTE predicate on the "optional_float32" field. +func OptionalFloat32GTE(v float32) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldOptionalFloat32, v)) +} + +// OptionalFloat32LT applies the LT predicate on the "optional_float32" field. +func OptionalFloat32LT(v float32) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldOptionalFloat32, v)) +} + +// OptionalFloat32LTE applies the LTE predicate on the "optional_float32" field. +func OptionalFloat32LTE(v float32) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldOptionalFloat32, v)) +} + +// OptionalFloat32IsNil applies the IsNil predicate on the "optional_float32" field. +func OptionalFloat32IsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldOptionalFloat32)) +} + +// OptionalFloat32NotNil applies the NotNil predicate on the "optional_float32" field. +func OptionalFloat32NotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldOptionalFloat32)) +} + +// TextEQ applies the EQ predicate on the "text" field. +func TextEQ(v string) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldText, v)) +} + +// TextNEQ applies the NEQ predicate on the "text" field. +func TextNEQ(v string) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldText, v)) +} + +// TextIn applies the In predicate on the "text" field. +func TextIn(vs ...string) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldText, vs...)) +} + +// TextNotIn applies the NotIn predicate on the "text" field. +func TextNotIn(vs ...string) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldText, vs...)) +} + +// TextGT applies the GT predicate on the "text" field. +func TextGT(v string) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldText, v)) +} + +// TextGTE applies the GTE predicate on the "text" field. +func TextGTE(v string) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldText, v)) +} + +// TextLT applies the LT predicate on the "text" field. +func TextLT(v string) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldText, v)) +} + +// TextLTE applies the LTE predicate on the "text" field. +func TextLTE(v string) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldText, v)) +} + +// TextContains applies the Contains predicate on the "text" field. +func TextContains(v string) predicate.FieldType { + return predicate.FieldType(sql.FieldContains(FieldText, v)) +} + +// TextHasPrefix applies the HasPrefix predicate on the "text" field. +func TextHasPrefix(v string) predicate.FieldType { + return predicate.FieldType(sql.FieldHasPrefix(FieldText, v)) +} + +// TextHasSuffix applies the HasSuffix predicate on the "text" field. +func TextHasSuffix(v string) predicate.FieldType { + return predicate.FieldType(sql.FieldHasSuffix(FieldText, v)) +} + +// TextIsNil applies the IsNil predicate on the "text" field. +func TextIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldText)) +} + +// TextNotNil applies the NotNil predicate on the "text" field. +func TextNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldText)) +} + +// TextEqualFold applies the EqualFold predicate on the "text" field. +func TextEqualFold(v string) predicate.FieldType { + return predicate.FieldType(sql.FieldEqualFold(FieldText, v)) +} + +// TextContainsFold applies the ContainsFold predicate on the "text" field. +func TextContainsFold(v string) predicate.FieldType { + return predicate.FieldType(sql.FieldContainsFold(FieldText, v)) +} + +// DatetimeEQ applies the EQ predicate on the "datetime" field. +func DatetimeEQ(v time.Time) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldDatetime, v)) +} + +// DatetimeNEQ applies the NEQ predicate on the "datetime" field. +func DatetimeNEQ(v time.Time) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldDatetime, v)) +} + +// DatetimeIn applies the In predicate on the "datetime" field. +func DatetimeIn(vs ...time.Time) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldDatetime, vs...)) +} + +// DatetimeNotIn applies the NotIn predicate on the "datetime" field. +func DatetimeNotIn(vs ...time.Time) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldDatetime, vs...)) +} + +// DatetimeGT applies the GT predicate on the "datetime" field. +func DatetimeGT(v time.Time) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldDatetime, v)) +} + +// DatetimeGTE applies the GTE predicate on the "datetime" field. +func DatetimeGTE(v time.Time) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldDatetime, v)) +} + +// DatetimeLT applies the LT predicate on the "datetime" field. +func DatetimeLT(v time.Time) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldDatetime, v)) +} + +// DatetimeLTE applies the LTE predicate on the "datetime" field. +func DatetimeLTE(v time.Time) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldDatetime, v)) +} + +// DatetimeIsNil applies the IsNil predicate on the "datetime" field. +func DatetimeIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldDatetime)) +} + +// DatetimeNotNil applies the NotNil predicate on the "datetime" field. +func DatetimeNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldDatetime)) +} + +// DecimalEQ applies the EQ predicate on the "decimal" field. +func DecimalEQ(v float64) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldDecimal, v)) +} + +// DecimalNEQ applies the NEQ predicate on the "decimal" field. +func DecimalNEQ(v float64) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldDecimal, v)) +} + +// DecimalIn applies the In predicate on the "decimal" field. +func DecimalIn(vs ...float64) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldDecimal, vs...)) +} + +// DecimalNotIn applies the NotIn predicate on the "decimal" field. +func DecimalNotIn(vs ...float64) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldDecimal, vs...)) +} + +// DecimalGT applies the GT predicate on the "decimal" field. +func DecimalGT(v float64) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldDecimal, v)) +} + +// DecimalGTE applies the GTE predicate on the "decimal" field. +func DecimalGTE(v float64) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldDecimal, v)) +} + +// DecimalLT applies the LT predicate on the "decimal" field. +func DecimalLT(v float64) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldDecimal, v)) +} + +// DecimalLTE applies the LTE predicate on the "decimal" field. +func DecimalLTE(v float64) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldDecimal, v)) +} + +// DecimalIsNil applies the IsNil predicate on the "decimal" field. +func DecimalIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldDecimal)) +} + +// DecimalNotNil applies the NotNil predicate on the "decimal" field. +func DecimalNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldDecimal)) +} + +// LinkOtherEQ applies the EQ predicate on the "link_other" field. +func LinkOtherEQ(v *schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldLinkOther, v)) +} + +// LinkOtherNEQ applies the NEQ predicate on the "link_other" field. +func LinkOtherNEQ(v *schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldLinkOther, v)) +} + +// LinkOtherIn applies the In predicate on the "link_other" field. +func LinkOtherIn(vs ...*schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldLinkOther, vs...)) +} + +// LinkOtherNotIn applies the NotIn predicate on the "link_other" field. +func LinkOtherNotIn(vs ...*schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldLinkOther, vs...)) +} + +// LinkOtherGT applies the GT predicate on the "link_other" field. +func LinkOtherGT(v *schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldLinkOther, v)) +} + +// LinkOtherGTE applies the GTE predicate on the "link_other" field. +func LinkOtherGTE(v *schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldLinkOther, v)) +} + +// LinkOtherLT applies the LT predicate on the "link_other" field. +func LinkOtherLT(v *schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldLinkOther, v)) +} + +// LinkOtherLTE applies the LTE predicate on the "link_other" field. +func LinkOtherLTE(v *schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldLinkOther, v)) +} + +// LinkOtherIsNil applies the IsNil predicate on the "link_other" field. +func LinkOtherIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldLinkOther)) +} + +// LinkOtherNotNil applies the NotNil predicate on the "link_other" field. +func LinkOtherNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldLinkOther)) +} + +// LinkOtherFuncEQ applies the EQ predicate on the "link_other_func" field. +func LinkOtherFuncEQ(v *schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldLinkOtherFunc, v)) +} + +// LinkOtherFuncNEQ applies the NEQ predicate on the "link_other_func" field. +func LinkOtherFuncNEQ(v *schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldLinkOtherFunc, v)) +} + +// LinkOtherFuncIn applies the In predicate on the "link_other_func" field. +func LinkOtherFuncIn(vs ...*schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldLinkOtherFunc, vs...)) +} + +// LinkOtherFuncNotIn applies the NotIn predicate on the "link_other_func" field. +func LinkOtherFuncNotIn(vs ...*schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldLinkOtherFunc, vs...)) +} + +// LinkOtherFuncGT applies the GT predicate on the "link_other_func" field. +func LinkOtherFuncGT(v *schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldLinkOtherFunc, v)) +} + +// LinkOtherFuncGTE applies the GTE predicate on the "link_other_func" field. +func LinkOtherFuncGTE(v *schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldLinkOtherFunc, v)) +} + +// LinkOtherFuncLT applies the LT predicate on the "link_other_func" field. +func LinkOtherFuncLT(v *schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldLinkOtherFunc, v)) +} + +// LinkOtherFuncLTE applies the LTE predicate on the "link_other_func" field. +func LinkOtherFuncLTE(v *schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldLinkOtherFunc, v)) +} + +// LinkOtherFuncIsNil applies the IsNil predicate on the "link_other_func" field. +func LinkOtherFuncIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldLinkOtherFunc)) +} + +// LinkOtherFuncNotNil applies the NotNil predicate on the "link_other_func" field. +func LinkOtherFuncNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldLinkOtherFunc)) +} + +// MACEQ applies the EQ predicate on the "mac" field. +func MACEQ(v schema.MAC) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldMAC, v)) +} + +// MACNEQ applies the NEQ predicate on the "mac" field. +func MACNEQ(v schema.MAC) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldMAC, v)) +} + +// MACIn applies the In predicate on the "mac" field. +func MACIn(vs ...schema.MAC) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldMAC, vs...)) +} + +// MACNotIn applies the NotIn predicate on the "mac" field. +func MACNotIn(vs ...schema.MAC) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldMAC, vs...)) +} + +// MACGT applies the GT predicate on the "mac" field. +func MACGT(v schema.MAC) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldMAC, v)) +} + +// MACGTE applies the GTE predicate on the "mac" field. +func MACGTE(v schema.MAC) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldMAC, v)) +} + +// MACLT applies the LT predicate on the "mac" field. +func MACLT(v schema.MAC) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldMAC, v)) +} + +// MACLTE applies the LTE predicate on the "mac" field. +func MACLTE(v schema.MAC) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldMAC, v)) +} + +// MACContains applies the Contains predicate on the "mac" field. +func MACContains(v schema.MAC) predicate.FieldType { + vc := v.String() + return predicate.FieldType(sql.FieldContains(FieldMAC, vc)) +} + +// MACHasPrefix applies the HasPrefix predicate on the "mac" field. +func MACHasPrefix(v schema.MAC) predicate.FieldType { + vc := v.String() + return predicate.FieldType(sql.FieldHasPrefix(FieldMAC, vc)) +} + +// MACHasSuffix applies the HasSuffix predicate on the "mac" field. +func MACHasSuffix(v schema.MAC) predicate.FieldType { + vc := v.String() + return predicate.FieldType(sql.FieldHasSuffix(FieldMAC, vc)) +} + +// MACIsNil applies the IsNil predicate on the "mac" field. +func MACIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldMAC)) +} + +// MACNotNil applies the NotNil predicate on the "mac" field. +func MACNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldMAC)) +} + +// MACEqualFold applies the EqualFold predicate on the "mac" field. +func MACEqualFold(v schema.MAC) predicate.FieldType { + vc := v.String() + return predicate.FieldType(sql.FieldEqualFold(FieldMAC, vc)) +} + +// MACContainsFold applies the ContainsFold predicate on the "mac" field. +func MACContainsFold(v schema.MAC) predicate.FieldType { + vc := v.String() + return predicate.FieldType(sql.FieldContainsFold(FieldMAC, vc)) +} + +// StringArrayEQ applies the EQ predicate on the "string_array" field. +func StringArrayEQ(v schema.Strings) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldStringArray, v)) +} + +// StringArrayNEQ applies the NEQ predicate on the "string_array" field. +func StringArrayNEQ(v schema.Strings) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldStringArray, v)) +} + +// StringArrayIn applies the In predicate on the "string_array" field. +func StringArrayIn(vs ...schema.Strings) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldStringArray, vs...)) +} + +// StringArrayNotIn applies the NotIn predicate on the "string_array" field. +func StringArrayNotIn(vs ...schema.Strings) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldStringArray, vs...)) +} + +// StringArrayGT applies the GT predicate on the "string_array" field. +func StringArrayGT(v schema.Strings) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldStringArray, v)) +} + +// StringArrayGTE applies the GTE predicate on the "string_array" field. +func StringArrayGTE(v schema.Strings) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldStringArray, v)) +} + +// StringArrayLT applies the LT predicate on the "string_array" field. +func StringArrayLT(v schema.Strings) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldStringArray, v)) +} + +// StringArrayLTE applies the LTE predicate on the "string_array" field. +func StringArrayLTE(v schema.Strings) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldStringArray, v)) +} + +// StringArrayIsNil applies the IsNil predicate on the "string_array" field. +func StringArrayIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldStringArray)) +} + +// StringArrayNotNil applies the NotNil predicate on the "string_array" field. +func StringArrayNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldStringArray)) +} + +// PasswordEQ applies the EQ predicate on the "password" field. +func PasswordEQ(v string) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldPassword, v)) +} + +// PasswordNEQ applies the NEQ predicate on the "password" field. +func PasswordNEQ(v string) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldPassword, v)) +} + +// PasswordIn applies the In predicate on the "password" field. +func PasswordIn(vs ...string) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldPassword, vs...)) +} + +// PasswordNotIn applies the NotIn predicate on the "password" field. +func PasswordNotIn(vs ...string) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldPassword, vs...)) +} + +// PasswordGT applies the GT predicate on the "password" field. +func PasswordGT(v string) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldPassword, v)) +} + +// PasswordGTE applies the GTE predicate on the "password" field. +func PasswordGTE(v string) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldPassword, v)) +} + +// PasswordLT applies the LT predicate on the "password" field. +func PasswordLT(v string) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldPassword, v)) +} + +// PasswordLTE applies the LTE predicate on the "password" field. +func PasswordLTE(v string) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldPassword, v)) +} + +// PasswordContains applies the Contains predicate on the "password" field. +func PasswordContains(v string) predicate.FieldType { + return predicate.FieldType(sql.FieldContains(FieldPassword, v)) +} + +// PasswordHasPrefix applies the HasPrefix predicate on the "password" field. +func PasswordHasPrefix(v string) predicate.FieldType { + return predicate.FieldType(sql.FieldHasPrefix(FieldPassword, v)) +} + +// PasswordHasSuffix applies the HasSuffix predicate on the "password" field. +func PasswordHasSuffix(v string) predicate.FieldType { + return predicate.FieldType(sql.FieldHasSuffix(FieldPassword, v)) +} + +// PasswordIsNil applies the IsNil predicate on the "password" field. +func PasswordIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldPassword)) +} + +// PasswordNotNil applies the NotNil predicate on the "password" field. +func PasswordNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldPassword)) +} + +// PasswordEqualFold applies the EqualFold predicate on the "password" field. +func PasswordEqualFold(v string) predicate.FieldType { + return predicate.FieldType(sql.FieldEqualFold(FieldPassword, v)) +} + +// PasswordContainsFold applies the ContainsFold predicate on the "password" field. +func PasswordContainsFold(v string) predicate.FieldType { + return predicate.FieldType(sql.FieldContainsFold(FieldPassword, v)) +} + +// StringScannerEQ applies the EQ predicate on the "string_scanner" field. +func StringScannerEQ(v schema.StringScanner) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldStringScanner, v)) +} + +// StringScannerNEQ applies the NEQ predicate on the "string_scanner" field. +func StringScannerNEQ(v schema.StringScanner) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldStringScanner, v)) +} + +// StringScannerIn applies the In predicate on the "string_scanner" field. +func StringScannerIn(vs ...schema.StringScanner) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldStringScanner, vs...)) +} + +// StringScannerNotIn applies the NotIn predicate on the "string_scanner" field. +func StringScannerNotIn(vs ...schema.StringScanner) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldStringScanner, vs...)) +} + +// StringScannerGT applies the GT predicate on the "string_scanner" field. +func StringScannerGT(v schema.StringScanner) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldStringScanner, v)) +} + +// StringScannerGTE applies the GTE predicate on the "string_scanner" field. +func StringScannerGTE(v schema.StringScanner) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldStringScanner, v)) +} + +// StringScannerLT applies the LT predicate on the "string_scanner" field. +func StringScannerLT(v schema.StringScanner) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldStringScanner, v)) +} + +// StringScannerLTE applies the LTE predicate on the "string_scanner" field. +func StringScannerLTE(v schema.StringScanner) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldStringScanner, v)) +} + +// StringScannerContains applies the Contains predicate on the "string_scanner" field. +func StringScannerContains(v schema.StringScanner) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldContains(FieldStringScanner, vc)) +} + +// StringScannerHasPrefix applies the HasPrefix predicate on the "string_scanner" field. +func StringScannerHasPrefix(v schema.StringScanner) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldHasPrefix(FieldStringScanner, vc)) +} + +// StringScannerHasSuffix applies the HasSuffix predicate on the "string_scanner" field. +func StringScannerHasSuffix(v schema.StringScanner) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldHasSuffix(FieldStringScanner, vc)) +} + +// StringScannerIsNil applies the IsNil predicate on the "string_scanner" field. +func StringScannerIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldStringScanner)) +} + +// StringScannerNotNil applies the NotNil predicate on the "string_scanner" field. +func StringScannerNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldStringScanner)) +} + +// StringScannerEqualFold applies the EqualFold predicate on the "string_scanner" field. +func StringScannerEqualFold(v schema.StringScanner) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldEqualFold(FieldStringScanner, vc)) +} + +// StringScannerContainsFold applies the ContainsFold predicate on the "string_scanner" field. +func StringScannerContainsFold(v schema.StringScanner) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldContainsFold(FieldStringScanner, vc)) +} + +// DurationEQ applies the EQ predicate on the "duration" field. +func DurationEQ(v time.Duration) predicate.FieldType { + vc := int64(v) + return predicate.FieldType(sql.FieldEQ(FieldDuration, vc)) +} + +// DurationNEQ applies the NEQ predicate on the "duration" field. +func DurationNEQ(v time.Duration) predicate.FieldType { + vc := int64(v) + return predicate.FieldType(sql.FieldNEQ(FieldDuration, vc)) +} + +// DurationIn applies the In predicate on the "duration" field. +func DurationIn(vs ...time.Duration) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = int64(vs[i]) + } + return predicate.FieldType(sql.FieldIn(FieldDuration, v...)) +} + +// DurationNotIn applies the NotIn predicate on the "duration" field. +func DurationNotIn(vs ...time.Duration) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = int64(vs[i]) + } + return predicate.FieldType(sql.FieldNotIn(FieldDuration, v...)) +} + +// DurationGT applies the GT predicate on the "duration" field. +func DurationGT(v time.Duration) predicate.FieldType { + vc := int64(v) + return predicate.FieldType(sql.FieldGT(FieldDuration, vc)) +} + +// DurationGTE applies the GTE predicate on the "duration" field. +func DurationGTE(v time.Duration) predicate.FieldType { + vc := int64(v) + return predicate.FieldType(sql.FieldGTE(FieldDuration, vc)) +} + +// DurationLT applies the LT predicate on the "duration" field. +func DurationLT(v time.Duration) predicate.FieldType { + vc := int64(v) + return predicate.FieldType(sql.FieldLT(FieldDuration, vc)) +} + +// DurationLTE applies the LTE predicate on the "duration" field. +func DurationLTE(v time.Duration) predicate.FieldType { + vc := int64(v) + return predicate.FieldType(sql.FieldLTE(FieldDuration, vc)) +} + +// DurationIsNil applies the IsNil predicate on the "duration" field. +func DurationIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldDuration)) +} + +// DurationNotNil applies the NotNil predicate on the "duration" field. +func DurationNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldDuration)) +} + +// DirEQ applies the EQ predicate on the "dir" field. +func DirEQ(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldEQ(FieldDir, vc)) +} + +// DirNEQ applies the NEQ predicate on the "dir" field. +func DirNEQ(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldNEQ(FieldDir, vc)) +} + +// DirIn applies the In predicate on the "dir" field. +func DirIn(vs ...http.Dir) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = string(vs[i]) + } + return predicate.FieldType(sql.FieldIn(FieldDir, v...)) +} + +// DirNotIn applies the NotIn predicate on the "dir" field. +func DirNotIn(vs ...http.Dir) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = string(vs[i]) + } + return predicate.FieldType(sql.FieldNotIn(FieldDir, v...)) +} + +// DirGT applies the GT predicate on the "dir" field. +func DirGT(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldGT(FieldDir, vc)) +} + +// DirGTE applies the GTE predicate on the "dir" field. +func DirGTE(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldGTE(FieldDir, vc)) +} + +// DirLT applies the LT predicate on the "dir" field. +func DirLT(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldLT(FieldDir, vc)) +} + +// DirLTE applies the LTE predicate on the "dir" field. +func DirLTE(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldLTE(FieldDir, vc)) +} + +// DirContains applies the Contains predicate on the "dir" field. +func DirContains(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldContains(FieldDir, vc)) +} + +// DirHasPrefix applies the HasPrefix predicate on the "dir" field. +func DirHasPrefix(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldHasPrefix(FieldDir, vc)) +} + +// DirHasSuffix applies the HasSuffix predicate on the "dir" field. +func DirHasSuffix(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldHasSuffix(FieldDir, vc)) +} + +// DirEqualFold applies the EqualFold predicate on the "dir" field. +func DirEqualFold(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldEqualFold(FieldDir, vc)) +} + +// DirContainsFold applies the ContainsFold predicate on the "dir" field. +func DirContainsFold(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldContainsFold(FieldDir, vc)) +} + +// NdirEQ applies the EQ predicate on the "ndir" field. +func NdirEQ(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldEQ(FieldNdir, vc)) +} + +// NdirNEQ applies the NEQ predicate on the "ndir" field. +func NdirNEQ(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldNEQ(FieldNdir, vc)) +} + +// NdirIn applies the In predicate on the "ndir" field. +func NdirIn(vs ...http.Dir) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = string(vs[i]) + } + return predicate.FieldType(sql.FieldIn(FieldNdir, v...)) +} + +// NdirNotIn applies the NotIn predicate on the "ndir" field. +func NdirNotIn(vs ...http.Dir) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = string(vs[i]) + } + return predicate.FieldType(sql.FieldNotIn(FieldNdir, v...)) +} + +// NdirGT applies the GT predicate on the "ndir" field. +func NdirGT(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldGT(FieldNdir, vc)) +} + +// NdirGTE applies the GTE predicate on the "ndir" field. +func NdirGTE(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldGTE(FieldNdir, vc)) +} + +// NdirLT applies the LT predicate on the "ndir" field. +func NdirLT(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldLT(FieldNdir, vc)) +} + +// NdirLTE applies the LTE predicate on the "ndir" field. +func NdirLTE(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldLTE(FieldNdir, vc)) +} + +// NdirContains applies the Contains predicate on the "ndir" field. +func NdirContains(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldContains(FieldNdir, vc)) +} + +// NdirHasPrefix applies the HasPrefix predicate on the "ndir" field. +func NdirHasPrefix(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldHasPrefix(FieldNdir, vc)) +} + +// NdirHasSuffix applies the HasSuffix predicate on the "ndir" field. +func NdirHasSuffix(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldHasSuffix(FieldNdir, vc)) +} + +// NdirIsNil applies the IsNil predicate on the "ndir" field. +func NdirIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldNdir)) +} + +// NdirNotNil applies the NotNil predicate on the "ndir" field. +func NdirNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldNdir)) +} + +// NdirEqualFold applies the EqualFold predicate on the "ndir" field. +func NdirEqualFold(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldEqualFold(FieldNdir, vc)) +} + +// NdirContainsFold applies the ContainsFold predicate on the "ndir" field. +func NdirContainsFold(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldContainsFold(FieldNdir, vc)) +} + +// StrEQ applies the EQ predicate on the "str" field. +func StrEQ(v sql.NullString) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldStr, v)) +} + +// StrNEQ applies the NEQ predicate on the "str" field. +func StrNEQ(v sql.NullString) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldStr, v)) +} + +// StrIn applies the In predicate on the "str" field. +func StrIn(vs ...sql.NullString) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldStr, vs...)) +} + +// StrNotIn applies the NotIn predicate on the "str" field. +func StrNotIn(vs ...sql.NullString) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldStr, vs...)) +} + +// StrGT applies the GT predicate on the "str" field. +func StrGT(v sql.NullString) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldStr, v)) +} + +// StrGTE applies the GTE predicate on the "str" field. +func StrGTE(v sql.NullString) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldStr, v)) +} + +// StrLT applies the LT predicate on the "str" field. +func StrLT(v sql.NullString) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldStr, v)) +} + +// StrLTE applies the LTE predicate on the "str" field. +func StrLTE(v sql.NullString) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldStr, v)) +} + +// StrContains applies the Contains predicate on the "str" field. +func StrContains(v sql.NullString) predicate.FieldType { + vc := v.String + return predicate.FieldType(sql.FieldContains(FieldStr, vc)) +} + +// StrHasPrefix applies the HasPrefix predicate on the "str" field. +func StrHasPrefix(v sql.NullString) predicate.FieldType { + vc := v.String + return predicate.FieldType(sql.FieldHasPrefix(FieldStr, vc)) +} + +// StrHasSuffix applies the HasSuffix predicate on the "str" field. +func StrHasSuffix(v sql.NullString) predicate.FieldType { + vc := v.String + return predicate.FieldType(sql.FieldHasSuffix(FieldStr, vc)) +} + +// StrIsNil applies the IsNil predicate on the "str" field. +func StrIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldStr)) +} + +// StrNotNil applies the NotNil predicate on the "str" field. +func StrNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldStr)) +} + +// StrEqualFold applies the EqualFold predicate on the "str" field. +func StrEqualFold(v sql.NullString) predicate.FieldType { + vc := v.String + return predicate.FieldType(sql.FieldEqualFold(FieldStr, vc)) +} + +// StrContainsFold applies the ContainsFold predicate on the "str" field. +func StrContainsFold(v sql.NullString) predicate.FieldType { + vc := v.String + return predicate.FieldType(sql.FieldContainsFold(FieldStr, vc)) +} + +// NullStrEQ applies the EQ predicate on the "null_str" field. +func NullStrEQ(v *sql.NullString) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldNullStr, v)) +} + +// NullStrNEQ applies the NEQ predicate on the "null_str" field. +func NullStrNEQ(v *sql.NullString) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldNullStr, v)) +} + +// NullStrIn applies the In predicate on the "null_str" field. +func NullStrIn(vs ...*sql.NullString) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldNullStr, vs...)) +} + +// NullStrNotIn applies the NotIn predicate on the "null_str" field. +func NullStrNotIn(vs ...*sql.NullString) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldNullStr, vs...)) +} + +// NullStrGT applies the GT predicate on the "null_str" field. +func NullStrGT(v *sql.NullString) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldNullStr, v)) +} + +// NullStrGTE applies the GTE predicate on the "null_str" field. +func NullStrGTE(v *sql.NullString) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldNullStr, v)) +} + +// NullStrLT applies the LT predicate on the "null_str" field. +func NullStrLT(v *sql.NullString) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldNullStr, v)) +} + +// NullStrLTE applies the LTE predicate on the "null_str" field. +func NullStrLTE(v *sql.NullString) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldNullStr, v)) +} + +// NullStrContains applies the Contains predicate on the "null_str" field. +func NullStrContains(v *sql.NullString) predicate.FieldType { + vc := v.String + return predicate.FieldType(sql.FieldContains(FieldNullStr, vc)) +} + +// NullStrHasPrefix applies the HasPrefix predicate on the "null_str" field. +func NullStrHasPrefix(v *sql.NullString) predicate.FieldType { + vc := v.String + return predicate.FieldType(sql.FieldHasPrefix(FieldNullStr, vc)) +} + +// NullStrHasSuffix applies the HasSuffix predicate on the "null_str" field. +func NullStrHasSuffix(v *sql.NullString) predicate.FieldType { + vc := v.String + return predicate.FieldType(sql.FieldHasSuffix(FieldNullStr, vc)) +} + +// NullStrIsNil applies the IsNil predicate on the "null_str" field. +func NullStrIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldNullStr)) +} + +// NullStrNotNil applies the NotNil predicate on the "null_str" field. +func NullStrNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldNullStr)) +} + +// NullStrEqualFold applies the EqualFold predicate on the "null_str" field. +func NullStrEqualFold(v *sql.NullString) predicate.FieldType { + vc := v.String + return predicate.FieldType(sql.FieldEqualFold(FieldNullStr, vc)) +} + +// NullStrContainsFold applies the ContainsFold predicate on the "null_str" field. +func NullStrContainsFold(v *sql.NullString) predicate.FieldType { + vc := v.String + return predicate.FieldType(sql.FieldContainsFold(FieldNullStr, vc)) +} + +// LinkEQ applies the EQ predicate on the "link" field. +func LinkEQ(v schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldLink, v)) +} + +// LinkNEQ applies the NEQ predicate on the "link" field. +func LinkNEQ(v schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldLink, v)) +} + +// LinkIn applies the In predicate on the "link" field. +func LinkIn(vs ...schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldLink, vs...)) +} + +// LinkNotIn applies the NotIn predicate on the "link" field. +func LinkNotIn(vs ...schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldLink, vs...)) +} + +// LinkGT applies the GT predicate on the "link" field. +func LinkGT(v schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldLink, v)) +} + +// LinkGTE applies the GTE predicate on the "link" field. +func LinkGTE(v schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldLink, v)) +} + +// LinkLT applies the LT predicate on the "link" field. +func LinkLT(v schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldLink, v)) +} + +// LinkLTE applies the LTE predicate on the "link" field. +func LinkLTE(v schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldLink, v)) +} + +// LinkContains applies the Contains predicate on the "link" field. +func LinkContains(v schema.Link) predicate.FieldType { + vc := v.String() + return predicate.FieldType(sql.FieldContains(FieldLink, vc)) +} + +// LinkHasPrefix applies the HasPrefix predicate on the "link" field. +func LinkHasPrefix(v schema.Link) predicate.FieldType { + vc := v.String() + return predicate.FieldType(sql.FieldHasPrefix(FieldLink, vc)) +} + +// LinkHasSuffix applies the HasSuffix predicate on the "link" field. +func LinkHasSuffix(v schema.Link) predicate.FieldType { + vc := v.String() + return predicate.FieldType(sql.FieldHasSuffix(FieldLink, vc)) +} + +// LinkIsNil applies the IsNil predicate on the "link" field. +func LinkIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldLink)) +} + +// LinkNotNil applies the NotNil predicate on the "link" field. +func LinkNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldLink)) +} + +// LinkEqualFold applies the EqualFold predicate on the "link" field. +func LinkEqualFold(v schema.Link) predicate.FieldType { + vc := v.String() + return predicate.FieldType(sql.FieldEqualFold(FieldLink, vc)) +} + +// LinkContainsFold applies the ContainsFold predicate on the "link" field. +func LinkContainsFold(v schema.Link) predicate.FieldType { + vc := v.String() + return predicate.FieldType(sql.FieldContainsFold(FieldLink, vc)) +} + +// NullLinkEQ applies the EQ predicate on the "null_link" field. +func NullLinkEQ(v *schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldNullLink, v)) +} + +// NullLinkNEQ applies the NEQ predicate on the "null_link" field. +func NullLinkNEQ(v *schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldNullLink, v)) +} + +// NullLinkIn applies the In predicate on the "null_link" field. +func NullLinkIn(vs ...*schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldNullLink, vs...)) +} + +// NullLinkNotIn applies the NotIn predicate on the "null_link" field. +func NullLinkNotIn(vs ...*schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldNullLink, vs...)) +} + +// NullLinkGT applies the GT predicate on the "null_link" field. +func NullLinkGT(v *schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldNullLink, v)) +} + +// NullLinkGTE applies the GTE predicate on the "null_link" field. +func NullLinkGTE(v *schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldNullLink, v)) +} + +// NullLinkLT applies the LT predicate on the "null_link" field. +func NullLinkLT(v *schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldNullLink, v)) +} + +// NullLinkLTE applies the LTE predicate on the "null_link" field. +func NullLinkLTE(v *schema.Link) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldNullLink, v)) +} + +// NullLinkContains applies the Contains predicate on the "null_link" field. +func NullLinkContains(v *schema.Link) predicate.FieldType { + vc := v.String() + return predicate.FieldType(sql.FieldContains(FieldNullLink, vc)) +} + +// NullLinkHasPrefix applies the HasPrefix predicate on the "null_link" field. +func NullLinkHasPrefix(v *schema.Link) predicate.FieldType { + vc := v.String() + return predicate.FieldType(sql.FieldHasPrefix(FieldNullLink, vc)) +} + +// NullLinkHasSuffix applies the HasSuffix predicate on the "null_link" field. +func NullLinkHasSuffix(v *schema.Link) predicate.FieldType { + vc := v.String() + return predicate.FieldType(sql.FieldHasSuffix(FieldNullLink, vc)) +} + +// NullLinkIsNil applies the IsNil predicate on the "null_link" field. +func NullLinkIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldNullLink)) +} + +// NullLinkNotNil applies the NotNil predicate on the "null_link" field. +func NullLinkNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldNullLink)) +} + +// NullLinkEqualFold applies the EqualFold predicate on the "null_link" field. +func NullLinkEqualFold(v *schema.Link) predicate.FieldType { + vc := v.String() + return predicate.FieldType(sql.FieldEqualFold(FieldNullLink, vc)) +} + +// NullLinkContainsFold applies the ContainsFold predicate on the "null_link" field. +func NullLinkContainsFold(v *schema.Link) predicate.FieldType { + vc := v.String() + return predicate.FieldType(sql.FieldContainsFold(FieldNullLink, vc)) +} + +// ActiveEQ applies the EQ predicate on the "active" field. +func ActiveEQ(v schema.Status) predicate.FieldType { + vc := bool(v) + return predicate.FieldType(sql.FieldEQ(FieldActive, vc)) +} + +// ActiveNEQ applies the NEQ predicate on the "active" field. +func ActiveNEQ(v schema.Status) predicate.FieldType { + vc := bool(v) + return predicate.FieldType(sql.FieldNEQ(FieldActive, vc)) +} + +// ActiveIsNil applies the IsNil predicate on the "active" field. +func ActiveIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldActive)) +} + +// ActiveNotNil applies the NotNil predicate on the "active" field. +func ActiveNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldActive)) +} + +// NullActiveEQ applies the EQ predicate on the "null_active" field. +func NullActiveEQ(v schema.Status) predicate.FieldType { + vc := bool(v) + return predicate.FieldType(sql.FieldEQ(FieldNullActive, vc)) +} + +// NullActiveNEQ applies the NEQ predicate on the "null_active" field. +func NullActiveNEQ(v schema.Status) predicate.FieldType { + vc := bool(v) + return predicate.FieldType(sql.FieldNEQ(FieldNullActive, vc)) +} + +// NullActiveIsNil applies the IsNil predicate on the "null_active" field. +func NullActiveIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldNullActive)) +} + +// NullActiveNotNil applies the NotNil predicate on the "null_active" field. +func NullActiveNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldNullActive)) +} + +// DeletedEQ applies the EQ predicate on the "deleted" field. +func DeletedEQ(v *sql.NullBool) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldDeleted, v)) +} + +// DeletedNEQ applies the NEQ predicate on the "deleted" field. +func DeletedNEQ(v *sql.NullBool) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldDeleted, v)) +} + +// DeletedIsNil applies the IsNil predicate on the "deleted" field. +func DeletedIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldDeleted)) +} + +// DeletedNotNil applies the NotNil predicate on the "deleted" field. +func DeletedNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldDeleted)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v *sql.NullTime) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v *sql.NullTime) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...*sql.NullTime) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...*sql.NullTime) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v *sql.NullTime) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v *sql.NullTime) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v *sql.NullTime) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v *sql.NullTime) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldDeletedAt)) +} + +// RawDataEQ applies the EQ predicate on the "raw_data" field. +func RawDataEQ(v []byte) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldRawData, v)) +} + +// RawDataNEQ applies the NEQ predicate on the "raw_data" field. +func RawDataNEQ(v []byte) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldRawData, v)) +} + +// RawDataIn applies the In predicate on the "raw_data" field. +func RawDataIn(vs ...[]byte) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldRawData, vs...)) +} + +// RawDataNotIn applies the NotIn predicate on the "raw_data" field. +func RawDataNotIn(vs ...[]byte) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldRawData, vs...)) +} + +// RawDataGT applies the GT predicate on the "raw_data" field. +func RawDataGT(v []byte) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldRawData, v)) +} + +// RawDataGTE applies the GTE predicate on the "raw_data" field. +func RawDataGTE(v []byte) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldRawData, v)) +} + +// RawDataLT applies the LT predicate on the "raw_data" field. +func RawDataLT(v []byte) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldRawData, v)) +} + +// RawDataLTE applies the LTE predicate on the "raw_data" field. +func RawDataLTE(v []byte) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldRawData, v)) +} + +// RawDataIsNil applies the IsNil predicate on the "raw_data" field. +func RawDataIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldRawData)) +} + +// RawDataNotNil applies the NotNil predicate on the "raw_data" field. +func RawDataNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldRawData)) +} + +// SensitiveEQ applies the EQ predicate on the "sensitive" field. +func SensitiveEQ(v []byte) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldSensitive, v)) +} + +// SensitiveNEQ applies the NEQ predicate on the "sensitive" field. +func SensitiveNEQ(v []byte) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldSensitive, v)) +} + +// SensitiveIn applies the In predicate on the "sensitive" field. +func SensitiveIn(vs ...[]byte) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldSensitive, vs...)) +} + +// SensitiveNotIn applies the NotIn predicate on the "sensitive" field. +func SensitiveNotIn(vs ...[]byte) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldSensitive, vs...)) +} + +// SensitiveGT applies the GT predicate on the "sensitive" field. +func SensitiveGT(v []byte) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldSensitive, v)) +} + +// SensitiveGTE applies the GTE predicate on the "sensitive" field. +func SensitiveGTE(v []byte) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldSensitive, v)) +} + +// SensitiveLT applies the LT predicate on the "sensitive" field. +func SensitiveLT(v []byte) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldSensitive, v)) +} + +// SensitiveLTE applies the LTE predicate on the "sensitive" field. +func SensitiveLTE(v []byte) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldSensitive, v)) +} + +// SensitiveIsNil applies the IsNil predicate on the "sensitive" field. +func SensitiveIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldSensitive)) +} + +// SensitiveNotNil applies the NotNil predicate on the "sensitive" field. +func SensitiveNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldSensitive)) +} + +// IPEQ applies the EQ predicate on the "ip" field. +func IPEQ(v net.IP) predicate.FieldType { + vc := []byte(v) + return predicate.FieldType(sql.FieldEQ(FieldIP, vc)) +} + +// IPNEQ applies the NEQ predicate on the "ip" field. +func IPNEQ(v net.IP) predicate.FieldType { + vc := []byte(v) + return predicate.FieldType(sql.FieldNEQ(FieldIP, vc)) +} + +// IPIn applies the In predicate on the "ip" field. +func IPIn(vs ...net.IP) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = []byte(vs[i]) + } + return predicate.FieldType(sql.FieldIn(FieldIP, v...)) +} + +// IPNotIn applies the NotIn predicate on the "ip" field. +func IPNotIn(vs ...net.IP) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = []byte(vs[i]) + } + return predicate.FieldType(sql.FieldNotIn(FieldIP, v...)) +} + +// IPGT applies the GT predicate on the "ip" field. +func IPGT(v net.IP) predicate.FieldType { + vc := []byte(v) + return predicate.FieldType(sql.FieldGT(FieldIP, vc)) +} + +// IPGTE applies the GTE predicate on the "ip" field. +func IPGTE(v net.IP) predicate.FieldType { + vc := []byte(v) + return predicate.FieldType(sql.FieldGTE(FieldIP, vc)) +} + +// IPLT applies the LT predicate on the "ip" field. +func IPLT(v net.IP) predicate.FieldType { + vc := []byte(v) + return predicate.FieldType(sql.FieldLT(FieldIP, vc)) +} + +// IPLTE applies the LTE predicate on the "ip" field. +func IPLTE(v net.IP) predicate.FieldType { + vc := []byte(v) + return predicate.FieldType(sql.FieldLTE(FieldIP, vc)) +} + +// IPIsNil applies the IsNil predicate on the "ip" field. +func IPIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldIP)) +} + +// IPNotNil applies the NotNil predicate on the "ip" field. +func IPNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldIP)) +} + +// NullInt64EQ applies the EQ predicate on the "null_int64" field. +func NullInt64EQ(v *sql.NullInt64) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldNullInt64, v)) +} + +// NullInt64NEQ applies the NEQ predicate on the "null_int64" field. +func NullInt64NEQ(v *sql.NullInt64) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldNullInt64, v)) +} + +// NullInt64In applies the In predicate on the "null_int64" field. +func NullInt64In(vs ...*sql.NullInt64) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldNullInt64, vs...)) +} + +// NullInt64NotIn applies the NotIn predicate on the "null_int64" field. +func NullInt64NotIn(vs ...*sql.NullInt64) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldNullInt64, vs...)) +} + +// NullInt64GT applies the GT predicate on the "null_int64" field. +func NullInt64GT(v *sql.NullInt64) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldNullInt64, v)) +} + +// NullInt64GTE applies the GTE predicate on the "null_int64" field. +func NullInt64GTE(v *sql.NullInt64) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldNullInt64, v)) +} + +// NullInt64LT applies the LT predicate on the "null_int64" field. +func NullInt64LT(v *sql.NullInt64) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldNullInt64, v)) +} + +// NullInt64LTE applies the LTE predicate on the "null_int64" field. +func NullInt64LTE(v *sql.NullInt64) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldNullInt64, v)) +} + +// NullInt64IsNil applies the IsNil predicate on the "null_int64" field. +func NullInt64IsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldNullInt64)) +} + +// NullInt64NotNil applies the NotNil predicate on the "null_int64" field. +func NullInt64NotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldNullInt64)) +} + +// SchemaIntEQ applies the EQ predicate on the "schema_int" field. +func SchemaIntEQ(v schema.Int) predicate.FieldType { + vc := int(v) + return predicate.FieldType(sql.FieldEQ(FieldSchemaInt, vc)) +} + +// SchemaIntNEQ applies the NEQ predicate on the "schema_int" field. +func SchemaIntNEQ(v schema.Int) predicate.FieldType { + vc := int(v) + return predicate.FieldType(sql.FieldNEQ(FieldSchemaInt, vc)) +} + +// SchemaIntIn applies the In predicate on the "schema_int" field. +func SchemaIntIn(vs ...schema.Int) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = int(vs[i]) + } + return predicate.FieldType(sql.FieldIn(FieldSchemaInt, v...)) +} + +// SchemaIntNotIn applies the NotIn predicate on the "schema_int" field. +func SchemaIntNotIn(vs ...schema.Int) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = int(vs[i]) + } + return predicate.FieldType(sql.FieldNotIn(FieldSchemaInt, v...)) +} + +// SchemaIntGT applies the GT predicate on the "schema_int" field. +func SchemaIntGT(v schema.Int) predicate.FieldType { + vc := int(v) + return predicate.FieldType(sql.FieldGT(FieldSchemaInt, vc)) +} + +// SchemaIntGTE applies the GTE predicate on the "schema_int" field. +func SchemaIntGTE(v schema.Int) predicate.FieldType { + vc := int(v) + return predicate.FieldType(sql.FieldGTE(FieldSchemaInt, vc)) +} + +// SchemaIntLT applies the LT predicate on the "schema_int" field. +func SchemaIntLT(v schema.Int) predicate.FieldType { + vc := int(v) + return predicate.FieldType(sql.FieldLT(FieldSchemaInt, vc)) +} + +// SchemaIntLTE applies the LTE predicate on the "schema_int" field. +func SchemaIntLTE(v schema.Int) predicate.FieldType { + vc := int(v) + return predicate.FieldType(sql.FieldLTE(FieldSchemaInt, vc)) +} + +// SchemaIntIsNil applies the IsNil predicate on the "schema_int" field. +func SchemaIntIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldSchemaInt)) +} + +// SchemaIntNotNil applies the NotNil predicate on the "schema_int" field. +func SchemaIntNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldSchemaInt)) +} + +// SchemaInt8EQ applies the EQ predicate on the "schema_int8" field. +func SchemaInt8EQ(v schema.Int8) predicate.FieldType { + vc := int8(v) + return predicate.FieldType(sql.FieldEQ(FieldSchemaInt8, vc)) +} + +// SchemaInt8NEQ applies the NEQ predicate on the "schema_int8" field. +func SchemaInt8NEQ(v schema.Int8) predicate.FieldType { + vc := int8(v) + return predicate.FieldType(sql.FieldNEQ(FieldSchemaInt8, vc)) +} + +// SchemaInt8In applies the In predicate on the "schema_int8" field. +func SchemaInt8In(vs ...schema.Int8) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = int8(vs[i]) + } + return predicate.FieldType(sql.FieldIn(FieldSchemaInt8, v...)) +} + +// SchemaInt8NotIn applies the NotIn predicate on the "schema_int8" field. +func SchemaInt8NotIn(vs ...schema.Int8) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = int8(vs[i]) + } + return predicate.FieldType(sql.FieldNotIn(FieldSchemaInt8, v...)) +} + +// SchemaInt8GT applies the GT predicate on the "schema_int8" field. +func SchemaInt8GT(v schema.Int8) predicate.FieldType { + vc := int8(v) + return predicate.FieldType(sql.FieldGT(FieldSchemaInt8, vc)) +} + +// SchemaInt8GTE applies the GTE predicate on the "schema_int8" field. +func SchemaInt8GTE(v schema.Int8) predicate.FieldType { + vc := int8(v) + return predicate.FieldType(sql.FieldGTE(FieldSchemaInt8, vc)) +} + +// SchemaInt8LT applies the LT predicate on the "schema_int8" field. +func SchemaInt8LT(v schema.Int8) predicate.FieldType { + vc := int8(v) + return predicate.FieldType(sql.FieldLT(FieldSchemaInt8, vc)) +} + +// SchemaInt8LTE applies the LTE predicate on the "schema_int8" field. +func SchemaInt8LTE(v schema.Int8) predicate.FieldType { + vc := int8(v) + return predicate.FieldType(sql.FieldLTE(FieldSchemaInt8, vc)) +} + +// SchemaInt8IsNil applies the IsNil predicate on the "schema_int8" field. +func SchemaInt8IsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldSchemaInt8)) +} + +// SchemaInt8NotNil applies the NotNil predicate on the "schema_int8" field. +func SchemaInt8NotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldSchemaInt8)) +} + +// SchemaInt64EQ applies the EQ predicate on the "schema_int64" field. +func SchemaInt64EQ(v schema.Int64) predicate.FieldType { + vc := int64(v) + return predicate.FieldType(sql.FieldEQ(FieldSchemaInt64, vc)) +} + +// SchemaInt64NEQ applies the NEQ predicate on the "schema_int64" field. +func SchemaInt64NEQ(v schema.Int64) predicate.FieldType { + vc := int64(v) + return predicate.FieldType(sql.FieldNEQ(FieldSchemaInt64, vc)) +} + +// SchemaInt64In applies the In predicate on the "schema_int64" field. +func SchemaInt64In(vs ...schema.Int64) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = int64(vs[i]) + } + return predicate.FieldType(sql.FieldIn(FieldSchemaInt64, v...)) +} + +// SchemaInt64NotIn applies the NotIn predicate on the "schema_int64" field. +func SchemaInt64NotIn(vs ...schema.Int64) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = int64(vs[i]) + } + return predicate.FieldType(sql.FieldNotIn(FieldSchemaInt64, v...)) +} + +// SchemaInt64GT applies the GT predicate on the "schema_int64" field. +func SchemaInt64GT(v schema.Int64) predicate.FieldType { + vc := int64(v) + return predicate.FieldType(sql.FieldGT(FieldSchemaInt64, vc)) +} + +// SchemaInt64GTE applies the GTE predicate on the "schema_int64" field. +func SchemaInt64GTE(v schema.Int64) predicate.FieldType { + vc := int64(v) + return predicate.FieldType(sql.FieldGTE(FieldSchemaInt64, vc)) +} + +// SchemaInt64LT applies the LT predicate on the "schema_int64" field. +func SchemaInt64LT(v schema.Int64) predicate.FieldType { + vc := int64(v) + return predicate.FieldType(sql.FieldLT(FieldSchemaInt64, vc)) +} + +// SchemaInt64LTE applies the LTE predicate on the "schema_int64" field. +func SchemaInt64LTE(v schema.Int64) predicate.FieldType { + vc := int64(v) + return predicate.FieldType(sql.FieldLTE(FieldSchemaInt64, vc)) +} + +// SchemaInt64IsNil applies the IsNil predicate on the "schema_int64" field. +func SchemaInt64IsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldSchemaInt64)) +} + +// SchemaInt64NotNil applies the NotNil predicate on the "schema_int64" field. +func SchemaInt64NotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldSchemaInt64)) +} + +// SchemaFloatEQ applies the EQ predicate on the "schema_float" field. +func SchemaFloatEQ(v schema.Float64) predicate.FieldType { + vc := float64(v) + return predicate.FieldType(sql.FieldEQ(FieldSchemaFloat, vc)) +} + +// SchemaFloatNEQ applies the NEQ predicate on the "schema_float" field. +func SchemaFloatNEQ(v schema.Float64) predicate.FieldType { + vc := float64(v) + return predicate.FieldType(sql.FieldNEQ(FieldSchemaFloat, vc)) +} + +// SchemaFloatIn applies the In predicate on the "schema_float" field. +func SchemaFloatIn(vs ...schema.Float64) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = float64(vs[i]) + } + return predicate.FieldType(sql.FieldIn(FieldSchemaFloat, v...)) +} + +// SchemaFloatNotIn applies the NotIn predicate on the "schema_float" field. +func SchemaFloatNotIn(vs ...schema.Float64) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = float64(vs[i]) + } + return predicate.FieldType(sql.FieldNotIn(FieldSchemaFloat, v...)) +} + +// SchemaFloatGT applies the GT predicate on the "schema_float" field. +func SchemaFloatGT(v schema.Float64) predicate.FieldType { + vc := float64(v) + return predicate.FieldType(sql.FieldGT(FieldSchemaFloat, vc)) +} + +// SchemaFloatGTE applies the GTE predicate on the "schema_float" field. +func SchemaFloatGTE(v schema.Float64) predicate.FieldType { + vc := float64(v) + return predicate.FieldType(sql.FieldGTE(FieldSchemaFloat, vc)) +} + +// SchemaFloatLT applies the LT predicate on the "schema_float" field. +func SchemaFloatLT(v schema.Float64) predicate.FieldType { + vc := float64(v) + return predicate.FieldType(sql.FieldLT(FieldSchemaFloat, vc)) +} + +// SchemaFloatLTE applies the LTE predicate on the "schema_float" field. +func SchemaFloatLTE(v schema.Float64) predicate.FieldType { + vc := float64(v) + return predicate.FieldType(sql.FieldLTE(FieldSchemaFloat, vc)) +} + +// SchemaFloatIsNil applies the IsNil predicate on the "schema_float" field. +func SchemaFloatIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldSchemaFloat)) +} + +// SchemaFloatNotNil applies the NotNil predicate on the "schema_float" field. +func SchemaFloatNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldSchemaFloat)) +} + +// SchemaFloat32EQ applies the EQ predicate on the "schema_float32" field. +func SchemaFloat32EQ(v schema.Float32) predicate.FieldType { + vc := float32(v) + return predicate.FieldType(sql.FieldEQ(FieldSchemaFloat32, vc)) +} + +// SchemaFloat32NEQ applies the NEQ predicate on the "schema_float32" field. +func SchemaFloat32NEQ(v schema.Float32) predicate.FieldType { + vc := float32(v) + return predicate.FieldType(sql.FieldNEQ(FieldSchemaFloat32, vc)) +} + +// SchemaFloat32In applies the In predicate on the "schema_float32" field. +func SchemaFloat32In(vs ...schema.Float32) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = float32(vs[i]) + } + return predicate.FieldType(sql.FieldIn(FieldSchemaFloat32, v...)) +} + +// SchemaFloat32NotIn applies the NotIn predicate on the "schema_float32" field. +func SchemaFloat32NotIn(vs ...schema.Float32) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = float32(vs[i]) + } + return predicate.FieldType(sql.FieldNotIn(FieldSchemaFloat32, v...)) +} + +// SchemaFloat32GT applies the GT predicate on the "schema_float32" field. +func SchemaFloat32GT(v schema.Float32) predicate.FieldType { + vc := float32(v) + return predicate.FieldType(sql.FieldGT(FieldSchemaFloat32, vc)) +} + +// SchemaFloat32GTE applies the GTE predicate on the "schema_float32" field. +func SchemaFloat32GTE(v schema.Float32) predicate.FieldType { + vc := float32(v) + return predicate.FieldType(sql.FieldGTE(FieldSchemaFloat32, vc)) +} + +// SchemaFloat32LT applies the LT predicate on the "schema_float32" field. +func SchemaFloat32LT(v schema.Float32) predicate.FieldType { + vc := float32(v) + return predicate.FieldType(sql.FieldLT(FieldSchemaFloat32, vc)) +} + +// SchemaFloat32LTE applies the LTE predicate on the "schema_float32" field. +func SchemaFloat32LTE(v schema.Float32) predicate.FieldType { + vc := float32(v) + return predicate.FieldType(sql.FieldLTE(FieldSchemaFloat32, vc)) +} + +// SchemaFloat32IsNil applies the IsNil predicate on the "schema_float32" field. +func SchemaFloat32IsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldSchemaFloat32)) +} + +// SchemaFloat32NotNil applies the NotNil predicate on the "schema_float32" field. +func SchemaFloat32NotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldSchemaFloat32)) +} + +// NullFloatEQ applies the EQ predicate on the "null_float" field. +func NullFloatEQ(v *sql.NullFloat64) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldNullFloat, v)) +} + +// NullFloatNEQ applies the NEQ predicate on the "null_float" field. +func NullFloatNEQ(v *sql.NullFloat64) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldNullFloat, v)) +} + +// NullFloatIn applies the In predicate on the "null_float" field. +func NullFloatIn(vs ...*sql.NullFloat64) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldNullFloat, vs...)) +} + +// NullFloatNotIn applies the NotIn predicate on the "null_float" field. +func NullFloatNotIn(vs ...*sql.NullFloat64) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldNullFloat, vs...)) +} + +// NullFloatGT applies the GT predicate on the "null_float" field. +func NullFloatGT(v *sql.NullFloat64) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldNullFloat, v)) +} + +// NullFloatGTE applies the GTE predicate on the "null_float" field. +func NullFloatGTE(v *sql.NullFloat64) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldNullFloat, v)) +} + +// NullFloatLT applies the LT predicate on the "null_float" field. +func NullFloatLT(v *sql.NullFloat64) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldNullFloat, v)) +} + +// NullFloatLTE applies the LTE predicate on the "null_float" field. +func NullFloatLTE(v *sql.NullFloat64) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldNullFloat, v)) +} + +// NullFloatIsNil applies the IsNil predicate on the "null_float" field. +func NullFloatIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldNullFloat)) +} + +// NullFloatNotNil applies the NotNil predicate on the "null_float" field. +func NullFloatNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldNullFloat)) +} + +// RoleEQ applies the EQ predicate on the "role" field. +func RoleEQ(v role.Role) predicate.FieldType { + vc := v + return predicate.FieldType(sql.FieldEQ(FieldRole, vc)) +} + +// RoleNEQ applies the NEQ predicate on the "role" field. +func RoleNEQ(v role.Role) predicate.FieldType { + vc := v + return predicate.FieldType(sql.FieldNEQ(FieldRole, vc)) +} + +// RoleIn applies the In predicate on the "role" field. +func RoleIn(vs ...role.Role) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.FieldType(sql.FieldIn(FieldRole, v...)) +} + +// RoleNotIn applies the NotIn predicate on the "role" field. +func RoleNotIn(vs ...role.Role) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.FieldType(sql.FieldNotIn(FieldRole, v...)) +} + +// PriorityEQ applies the EQ predicate on the "priority" field. +func PriorityEQ(v role.Priority) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldPriority, v)) +} + +// PriorityNEQ applies the NEQ predicate on the "priority" field. +func PriorityNEQ(v role.Priority) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldPriority, v)) +} + +// PriorityIn applies the In predicate on the "priority" field. +func PriorityIn(vs ...role.Priority) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldPriority, vs...)) +} + +// PriorityNotIn applies the NotIn predicate on the "priority" field. +func PriorityNotIn(vs ...role.Priority) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldPriority, vs...)) +} + +// PriorityIsNil applies the IsNil predicate on the "priority" field. +func PriorityIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldPriority)) +} + +// PriorityNotNil applies the NotNil predicate on the "priority" field. +func PriorityNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldPriority)) +} + +// OptionalUUIDEQ applies the EQ predicate on the "optional_uuid" field. +func OptionalUUIDEQ(v uuid.UUID) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldOptionalUUID, v)) +} + +// OptionalUUIDNEQ applies the NEQ predicate on the "optional_uuid" field. +func OptionalUUIDNEQ(v uuid.UUID) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldOptionalUUID, v)) +} + +// OptionalUUIDIn applies the In predicate on the "optional_uuid" field. +func OptionalUUIDIn(vs ...uuid.UUID) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldOptionalUUID, vs...)) +} + +// OptionalUUIDNotIn applies the NotIn predicate on the "optional_uuid" field. +func OptionalUUIDNotIn(vs ...uuid.UUID) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldOptionalUUID, vs...)) +} + +// OptionalUUIDGT applies the GT predicate on the "optional_uuid" field. +func OptionalUUIDGT(v uuid.UUID) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldOptionalUUID, v)) +} + +// OptionalUUIDGTE applies the GTE predicate on the "optional_uuid" field. +func OptionalUUIDGTE(v uuid.UUID) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldOptionalUUID, v)) +} + +// OptionalUUIDLT applies the LT predicate on the "optional_uuid" field. +func OptionalUUIDLT(v uuid.UUID) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldOptionalUUID, v)) +} + +// OptionalUUIDLTE applies the LTE predicate on the "optional_uuid" field. +func OptionalUUIDLTE(v uuid.UUID) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldOptionalUUID, v)) +} + +// OptionalUUIDIsNil applies the IsNil predicate on the "optional_uuid" field. +func OptionalUUIDIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldOptionalUUID)) +} + +// OptionalUUIDNotNil applies the NotNil predicate on the "optional_uuid" field. +func OptionalUUIDNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldOptionalUUID)) +} + +// NillableUUIDEQ applies the EQ predicate on the "nillable_uuid" field. +func NillableUUIDEQ(v uuid.UUID) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldNillableUUID, v)) +} + +// NillableUUIDNEQ applies the NEQ predicate on the "nillable_uuid" field. +func NillableUUIDNEQ(v uuid.UUID) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldNillableUUID, v)) +} + +// NillableUUIDIn applies the In predicate on the "nillable_uuid" field. +func NillableUUIDIn(vs ...uuid.UUID) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldNillableUUID, vs...)) +} + +// NillableUUIDNotIn applies the NotIn predicate on the "nillable_uuid" field. +func NillableUUIDNotIn(vs ...uuid.UUID) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldNillableUUID, vs...)) +} + +// NillableUUIDGT applies the GT predicate on the "nillable_uuid" field. +func NillableUUIDGT(v uuid.UUID) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldNillableUUID, v)) +} + +// NillableUUIDGTE applies the GTE predicate on the "nillable_uuid" field. +func NillableUUIDGTE(v uuid.UUID) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldNillableUUID, v)) +} + +// NillableUUIDLT applies the LT predicate on the "nillable_uuid" field. +func NillableUUIDLT(v uuid.UUID) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldNillableUUID, v)) +} + +// NillableUUIDLTE applies the LTE predicate on the "nillable_uuid" field. +func NillableUUIDLTE(v uuid.UUID) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldNillableUUID, v)) +} + +// NillableUUIDIsNil applies the IsNil predicate on the "nillable_uuid" field. +func NillableUUIDIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldNillableUUID)) +} + +// NillableUUIDNotNil applies the NotNil predicate on the "nillable_uuid" field. +func NillableUUIDNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldNillableUUID)) +} + +// StringsIsNil applies the IsNil predicate on the "strings" field. +func StringsIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldStrings)) +} + +// StringsNotNil applies the NotNil predicate on the "strings" field. +func StringsNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldStrings)) +} + +// PairEQ applies the EQ predicate on the "pair" field. +func PairEQ(v schema.Pair) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldPair, v)) +} + +// PairNEQ applies the NEQ predicate on the "pair" field. +func PairNEQ(v schema.Pair) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldPair, v)) +} + +// PairIn applies the In predicate on the "pair" field. +func PairIn(vs ...schema.Pair) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldPair, vs...)) +} + +// PairNotIn applies the NotIn predicate on the "pair" field. +func PairNotIn(vs ...schema.Pair) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldPair, vs...)) +} + +// PairGT applies the GT predicate on the "pair" field. +func PairGT(v schema.Pair) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldPair, v)) +} + +// PairGTE applies the GTE predicate on the "pair" field. +func PairGTE(v schema.Pair) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldPair, v)) +} + +// PairLT applies the LT predicate on the "pair" field. +func PairLT(v schema.Pair) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldPair, v)) +} + +// PairLTE applies the LTE predicate on the "pair" field. +func PairLTE(v schema.Pair) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldPair, v)) +} + +// NilPairEQ applies the EQ predicate on the "nil_pair" field. +func NilPairEQ(v *schema.Pair) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldNilPair, v)) +} + +// NilPairNEQ applies the NEQ predicate on the "nil_pair" field. +func NilPairNEQ(v *schema.Pair) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldNilPair, v)) +} + +// NilPairIn applies the In predicate on the "nil_pair" field. +func NilPairIn(vs ...*schema.Pair) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldNilPair, vs...)) +} + +// NilPairNotIn applies the NotIn predicate on the "nil_pair" field. +func NilPairNotIn(vs ...*schema.Pair) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldNilPair, vs...)) +} + +// NilPairGT applies the GT predicate on the "nil_pair" field. +func NilPairGT(v *schema.Pair) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldNilPair, v)) +} + +// NilPairGTE applies the GTE predicate on the "nil_pair" field. +func NilPairGTE(v *schema.Pair) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldNilPair, v)) +} + +// NilPairLT applies the LT predicate on the "nil_pair" field. +func NilPairLT(v *schema.Pair) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldNilPair, v)) +} + +// NilPairLTE applies the LTE predicate on the "nil_pair" field. +func NilPairLTE(v *schema.Pair) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldNilPair, v)) +} + +// NilPairIsNil applies the IsNil predicate on the "nil_pair" field. +func NilPairIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldNilPair)) +} + +// NilPairNotNil applies the NotNil predicate on the "nil_pair" field. +func NilPairNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldNilPair)) +} + +// VstringEQ applies the EQ predicate on the "vstring" field. +func VstringEQ(v schema.VString) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldVstring, v)) +} + +// VstringNEQ applies the NEQ predicate on the "vstring" field. +func VstringNEQ(v schema.VString) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldVstring, v)) +} + +// VstringIn applies the In predicate on the "vstring" field. +func VstringIn(vs ...schema.VString) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldVstring, vs...)) +} + +// VstringNotIn applies the NotIn predicate on the "vstring" field. +func VstringNotIn(vs ...schema.VString) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldVstring, vs...)) +} + +// VstringGT applies the GT predicate on the "vstring" field. +func VstringGT(v schema.VString) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldVstring, v)) +} + +// VstringGTE applies the GTE predicate on the "vstring" field. +func VstringGTE(v schema.VString) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldVstring, v)) +} + +// VstringLT applies the LT predicate on the "vstring" field. +func VstringLT(v schema.VString) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldVstring, v)) +} + +// VstringLTE applies the LTE predicate on the "vstring" field. +func VstringLTE(v schema.VString) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldVstring, v)) +} + +// VstringContains applies the Contains predicate on the "vstring" field. +func VstringContains(v schema.VString) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldContains(FieldVstring, vc)) +} + +// VstringHasPrefix applies the HasPrefix predicate on the "vstring" field. +func VstringHasPrefix(v schema.VString) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldHasPrefix(FieldVstring, vc)) +} + +// VstringHasSuffix applies the HasSuffix predicate on the "vstring" field. +func VstringHasSuffix(v schema.VString) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldHasSuffix(FieldVstring, vc)) +} + +// VstringEqualFold applies the EqualFold predicate on the "vstring" field. +func VstringEqualFold(v schema.VString) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldEqualFold(FieldVstring, vc)) +} + +// VstringContainsFold applies the ContainsFold predicate on the "vstring" field. +func VstringContainsFold(v schema.VString) predicate.FieldType { + vc := string(v) + return predicate.FieldType(sql.FieldContainsFold(FieldVstring, vc)) +} + +// TripleEQ applies the EQ predicate on the "triple" field. +func TripleEQ(v schema.Triple) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldTriple, v)) +} + +// TripleNEQ applies the NEQ predicate on the "triple" field. +func TripleNEQ(v schema.Triple) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldTriple, v)) +} + +// TripleIn applies the In predicate on the "triple" field. +func TripleIn(vs ...schema.Triple) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldTriple, vs...)) +} + +// TripleNotIn applies the NotIn predicate on the "triple" field. +func TripleNotIn(vs ...schema.Triple) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldTriple, vs...)) +} + +// TripleGT applies the GT predicate on the "triple" field. +func TripleGT(v schema.Triple) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldTriple, v)) +} + +// TripleGTE applies the GTE predicate on the "triple" field. +func TripleGTE(v schema.Triple) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldTriple, v)) +} + +// TripleLT applies the LT predicate on the "triple" field. +func TripleLT(v schema.Triple) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldTriple, v)) +} + +// TripleLTE applies the LTE predicate on the "triple" field. +func TripleLTE(v schema.Triple) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldTriple, v)) +} + +// BigIntEQ applies the EQ predicate on the "big_int" field. +func BigIntEQ(v schema.BigInt) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldBigInt, v)) +} + +// BigIntNEQ applies the NEQ predicate on the "big_int" field. +func BigIntNEQ(v schema.BigInt) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldBigInt, v)) +} + +// BigIntIn applies the In predicate on the "big_int" field. +func BigIntIn(vs ...schema.BigInt) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldBigInt, vs...)) +} + +// BigIntNotIn applies the NotIn predicate on the "big_int" field. +func BigIntNotIn(vs ...schema.BigInt) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldBigInt, vs...)) +} + +// BigIntGT applies the GT predicate on the "big_int" field. +func BigIntGT(v schema.BigInt) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldBigInt, v)) +} + +// BigIntGTE applies the GTE predicate on the "big_int" field. +func BigIntGTE(v schema.BigInt) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldBigInt, v)) +} + +// BigIntLT applies the LT predicate on the "big_int" field. +func BigIntLT(v schema.BigInt) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldBigInt, v)) +} + +// BigIntLTE applies the LTE predicate on the "big_int" field. +func BigIntLTE(v schema.BigInt) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldBigInt, v)) +} + +// BigIntIsNil applies the IsNil predicate on the "big_int" field. +func BigIntIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldBigInt)) +} + +// BigIntNotNil applies the NotNil predicate on the "big_int" field. +func BigIntNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldBigInt)) +} + +// PasswordOtherEQ applies the EQ predicate on the "password_other" field. +func PasswordOtherEQ(v schema.Password) predicate.FieldType { + return predicate.FieldType(sql.FieldEQ(FieldPasswordOther, v)) +} + +// PasswordOtherNEQ applies the NEQ predicate on the "password_other" field. +func PasswordOtherNEQ(v schema.Password) predicate.FieldType { + return predicate.FieldType(sql.FieldNEQ(FieldPasswordOther, v)) +} + +// PasswordOtherIn applies the In predicate on the "password_other" field. +func PasswordOtherIn(vs ...schema.Password) predicate.FieldType { + return predicate.FieldType(sql.FieldIn(FieldPasswordOther, vs...)) +} + +// PasswordOtherNotIn applies the NotIn predicate on the "password_other" field. +func PasswordOtherNotIn(vs ...schema.Password) predicate.FieldType { + return predicate.FieldType(sql.FieldNotIn(FieldPasswordOther, vs...)) +} + +// PasswordOtherGT applies the GT predicate on the "password_other" field. +func PasswordOtherGT(v schema.Password) predicate.FieldType { + return predicate.FieldType(sql.FieldGT(FieldPasswordOther, v)) +} + +// PasswordOtherGTE applies the GTE predicate on the "password_other" field. +func PasswordOtherGTE(v schema.Password) predicate.FieldType { + return predicate.FieldType(sql.FieldGTE(FieldPasswordOther, v)) +} + +// PasswordOtherLT applies the LT predicate on the "password_other" field. +func PasswordOtherLT(v schema.Password) predicate.FieldType { + return predicate.FieldType(sql.FieldLT(FieldPasswordOther, v)) +} + +// PasswordOtherLTE applies the LTE predicate on the "password_other" field. +func PasswordOtherLTE(v schema.Password) predicate.FieldType { + return predicate.FieldType(sql.FieldLTE(FieldPasswordOther, v)) +} + +// PasswordOtherIsNil applies the IsNil predicate on the "password_other" field. +func PasswordOtherIsNil() predicate.FieldType { + return predicate.FieldType(sql.FieldIsNull(FieldPasswordOther)) +} + +// PasswordOtherNotNil applies the NotNil predicate on the "password_other" field. +func PasswordOtherNotNil() predicate.FieldType { + return predicate.FieldType(sql.FieldNotNull(FieldPasswordOther)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.FieldType) predicate.FieldType { + return predicate.FieldType(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.FieldType) predicate.FieldType { + return predicate.FieldType(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.FieldType) predicate.FieldType { + return predicate.FieldType(sql.NotPredicates(p)) +} diff --git a/entc/integration/ent/fieldtype_create.go b/entc/integration/ent/fieldtype_create.go new file mode 100644 index 0000000..5b4f877 --- /dev/null +++ b/entc/integration/ent/fieldtype_create.go @@ -0,0 +1,5874 @@ +// 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 ent + +import ( + "context" + "errors" + "fmt" + "net" + "net/http" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/entc/integration/ent/fieldtype" + "entgo.io/ent/entc/integration/ent/role" + "entgo.io/ent/entc/integration/ent/schema" + "entgo.io/ent/schema/field" + "github.com/google/uuid" +) + +// FieldTypeCreate is the builder for creating a FieldType entity. +type FieldTypeCreate struct { + config + mutation *FieldTypeMutation + hooks []Hook + conflict []sql.ConflictOption +} + +// SetInt sets the "int" field. +func (_c *FieldTypeCreate) SetInt(v int) *FieldTypeCreate { + _c.mutation.SetInt(v) + return _c +} + +// SetInt8 sets the "int8" field. +func (_c *FieldTypeCreate) SetInt8(v int8) *FieldTypeCreate { + _c.mutation.SetInt8(v) + return _c +} + +// SetInt16 sets the "int16" field. +func (_c *FieldTypeCreate) SetInt16(v int16) *FieldTypeCreate { + _c.mutation.SetInt16(v) + return _c +} + +// SetInt32 sets the "int32" field. +func (_c *FieldTypeCreate) SetInt32(v int32) *FieldTypeCreate { + _c.mutation.SetInt32(v) + return _c +} + +// SetInt64 sets the "int64" field. +func (_c *FieldTypeCreate) SetInt64(v int64) *FieldTypeCreate { + _c.mutation.SetInt64(v) + return _c +} + +// SetOptionalInt sets the "optional_int" field. +func (_c *FieldTypeCreate) SetOptionalInt(v int) *FieldTypeCreate { + _c.mutation.SetOptionalInt(v) + return _c +} + +// SetNillableOptionalInt sets the "optional_int" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableOptionalInt(v *int) *FieldTypeCreate { + if v != nil { + _c.SetOptionalInt(*v) + } + return _c +} + +// SetOptionalInt8 sets the "optional_int8" field. +func (_c *FieldTypeCreate) SetOptionalInt8(v int8) *FieldTypeCreate { + _c.mutation.SetOptionalInt8(v) + return _c +} + +// SetNillableOptionalInt8 sets the "optional_int8" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableOptionalInt8(v *int8) *FieldTypeCreate { + if v != nil { + _c.SetOptionalInt8(*v) + } + return _c +} + +// SetOptionalInt16 sets the "optional_int16" field. +func (_c *FieldTypeCreate) SetOptionalInt16(v int16) *FieldTypeCreate { + _c.mutation.SetOptionalInt16(v) + return _c +} + +// SetNillableOptionalInt16 sets the "optional_int16" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableOptionalInt16(v *int16) *FieldTypeCreate { + if v != nil { + _c.SetOptionalInt16(*v) + } + return _c +} + +// SetOptionalInt32 sets the "optional_int32" field. +func (_c *FieldTypeCreate) SetOptionalInt32(v int32) *FieldTypeCreate { + _c.mutation.SetOptionalInt32(v) + return _c +} + +// SetNillableOptionalInt32 sets the "optional_int32" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableOptionalInt32(v *int32) *FieldTypeCreate { + if v != nil { + _c.SetOptionalInt32(*v) + } + return _c +} + +// SetOptionalInt64 sets the "optional_int64" field. +func (_c *FieldTypeCreate) SetOptionalInt64(v int64) *FieldTypeCreate { + _c.mutation.SetOptionalInt64(v) + return _c +} + +// SetNillableOptionalInt64 sets the "optional_int64" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableOptionalInt64(v *int64) *FieldTypeCreate { + if v != nil { + _c.SetOptionalInt64(*v) + } + return _c +} + +// SetNillableInt sets the "nillable_int" field. +func (_c *FieldTypeCreate) SetNillableInt(v int) *FieldTypeCreate { + _c.mutation.SetNillableInt(v) + return _c +} + +// SetNillableNillableInt sets the "nillable_int" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableNillableInt(v *int) *FieldTypeCreate { + if v != nil { + _c.SetNillableInt(*v) + } + return _c +} + +// SetNillableInt8 sets the "nillable_int8" field. +func (_c *FieldTypeCreate) SetNillableInt8(v int8) *FieldTypeCreate { + _c.mutation.SetNillableInt8(v) + return _c +} + +// SetNillableNillableInt8 sets the "nillable_int8" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableNillableInt8(v *int8) *FieldTypeCreate { + if v != nil { + _c.SetNillableInt8(*v) + } + return _c +} + +// SetNillableInt16 sets the "nillable_int16" field. +func (_c *FieldTypeCreate) SetNillableInt16(v int16) *FieldTypeCreate { + _c.mutation.SetNillableInt16(v) + return _c +} + +// SetNillableNillableInt16 sets the "nillable_int16" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableNillableInt16(v *int16) *FieldTypeCreate { + if v != nil { + _c.SetNillableInt16(*v) + } + return _c +} + +// SetNillableInt32 sets the "nillable_int32" field. +func (_c *FieldTypeCreate) SetNillableInt32(v int32) *FieldTypeCreate { + _c.mutation.SetNillableInt32(v) + return _c +} + +// SetNillableNillableInt32 sets the "nillable_int32" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableNillableInt32(v *int32) *FieldTypeCreate { + if v != nil { + _c.SetNillableInt32(*v) + } + return _c +} + +// SetNillableInt64 sets the "nillable_int64" field. +func (_c *FieldTypeCreate) SetNillableInt64(v int64) *FieldTypeCreate { + _c.mutation.SetNillableInt64(v) + return _c +} + +// SetNillableNillableInt64 sets the "nillable_int64" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableNillableInt64(v *int64) *FieldTypeCreate { + if v != nil { + _c.SetNillableInt64(*v) + } + return _c +} + +// SetValidateOptionalInt32 sets the "validate_optional_int32" field. +func (_c *FieldTypeCreate) SetValidateOptionalInt32(v int32) *FieldTypeCreate { + _c.mutation.SetValidateOptionalInt32(v) + return _c +} + +// SetNillableValidateOptionalInt32 sets the "validate_optional_int32" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableValidateOptionalInt32(v *int32) *FieldTypeCreate { + if v != nil { + _c.SetValidateOptionalInt32(*v) + } + return _c +} + +// SetOptionalUint sets the "optional_uint" field. +func (_c *FieldTypeCreate) SetOptionalUint(v uint) *FieldTypeCreate { + _c.mutation.SetOptionalUint(v) + return _c +} + +// SetNillableOptionalUint sets the "optional_uint" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableOptionalUint(v *uint) *FieldTypeCreate { + if v != nil { + _c.SetOptionalUint(*v) + } + return _c +} + +// SetOptionalUint8 sets the "optional_uint8" field. +func (_c *FieldTypeCreate) SetOptionalUint8(v uint8) *FieldTypeCreate { + _c.mutation.SetOptionalUint8(v) + return _c +} + +// SetNillableOptionalUint8 sets the "optional_uint8" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableOptionalUint8(v *uint8) *FieldTypeCreate { + if v != nil { + _c.SetOptionalUint8(*v) + } + return _c +} + +// SetOptionalUint16 sets the "optional_uint16" field. +func (_c *FieldTypeCreate) SetOptionalUint16(v uint16) *FieldTypeCreate { + _c.mutation.SetOptionalUint16(v) + return _c +} + +// SetNillableOptionalUint16 sets the "optional_uint16" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableOptionalUint16(v *uint16) *FieldTypeCreate { + if v != nil { + _c.SetOptionalUint16(*v) + } + return _c +} + +// SetOptionalUint32 sets the "optional_uint32" field. +func (_c *FieldTypeCreate) SetOptionalUint32(v uint32) *FieldTypeCreate { + _c.mutation.SetOptionalUint32(v) + return _c +} + +// SetNillableOptionalUint32 sets the "optional_uint32" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableOptionalUint32(v *uint32) *FieldTypeCreate { + if v != nil { + _c.SetOptionalUint32(*v) + } + return _c +} + +// SetOptionalUint64 sets the "optional_uint64" field. +func (_c *FieldTypeCreate) SetOptionalUint64(v uint64) *FieldTypeCreate { + _c.mutation.SetOptionalUint64(v) + return _c +} + +// SetNillableOptionalUint64 sets the "optional_uint64" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableOptionalUint64(v *uint64) *FieldTypeCreate { + if v != nil { + _c.SetOptionalUint64(*v) + } + return _c +} + +// SetState sets the "state" field. +func (_c *FieldTypeCreate) SetState(v fieldtype.State) *FieldTypeCreate { + _c.mutation.SetState(v) + return _c +} + +// SetNillableState sets the "state" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableState(v *fieldtype.State) *FieldTypeCreate { + if v != nil { + _c.SetState(*v) + } + return _c +} + +// SetOptionalFloat sets the "optional_float" field. +func (_c *FieldTypeCreate) SetOptionalFloat(v float64) *FieldTypeCreate { + _c.mutation.SetOptionalFloat(v) + return _c +} + +// SetNillableOptionalFloat sets the "optional_float" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableOptionalFloat(v *float64) *FieldTypeCreate { + if v != nil { + _c.SetOptionalFloat(*v) + } + return _c +} + +// SetOptionalFloat32 sets the "optional_float32" field. +func (_c *FieldTypeCreate) SetOptionalFloat32(v float32) *FieldTypeCreate { + _c.mutation.SetOptionalFloat32(v) + return _c +} + +// SetNillableOptionalFloat32 sets the "optional_float32" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableOptionalFloat32(v *float32) *FieldTypeCreate { + if v != nil { + _c.SetOptionalFloat32(*v) + } + return _c +} + +// SetText sets the "text" field. +func (_c *FieldTypeCreate) SetText(v string) *FieldTypeCreate { + _c.mutation.SetText(v) + return _c +} + +// SetNillableText sets the "text" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableText(v *string) *FieldTypeCreate { + if v != nil { + _c.SetText(*v) + } + return _c +} + +// SetDatetime sets the "datetime" field. +func (_c *FieldTypeCreate) SetDatetime(v time.Time) *FieldTypeCreate { + _c.mutation.SetDatetime(v) + return _c +} + +// SetNillableDatetime sets the "datetime" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableDatetime(v *time.Time) *FieldTypeCreate { + if v != nil { + _c.SetDatetime(*v) + } + return _c +} + +// SetDecimal sets the "decimal" field. +func (_c *FieldTypeCreate) SetDecimal(v float64) *FieldTypeCreate { + _c.mutation.SetDecimal(v) + return _c +} + +// SetNillableDecimal sets the "decimal" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableDecimal(v *float64) *FieldTypeCreate { + if v != nil { + _c.SetDecimal(*v) + } + return _c +} + +// SetLinkOther sets the "link_other" field. +func (_c *FieldTypeCreate) SetLinkOther(v *schema.Link) *FieldTypeCreate { + _c.mutation.SetLinkOther(v) + return _c +} + +// SetLinkOtherFunc sets the "link_other_func" field. +func (_c *FieldTypeCreate) SetLinkOtherFunc(v *schema.Link) *FieldTypeCreate { + _c.mutation.SetLinkOtherFunc(v) + return _c +} + +// SetMAC sets the "mac" field. +func (_c *FieldTypeCreate) SetMAC(v schema.MAC) *FieldTypeCreate { + _c.mutation.SetMAC(v) + return _c +} + +// SetNillableMAC sets the "mac" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableMAC(v *schema.MAC) *FieldTypeCreate { + if v != nil { + _c.SetMAC(*v) + } + return _c +} + +// SetStringArray sets the "string_array" field. +func (_c *FieldTypeCreate) SetStringArray(v schema.Strings) *FieldTypeCreate { + _c.mutation.SetStringArray(v) + return _c +} + +// SetPassword sets the "password" field. +func (_c *FieldTypeCreate) SetPassword(v string) *FieldTypeCreate { + _c.mutation.SetPassword(v) + return _c +} + +// SetNillablePassword sets the "password" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillablePassword(v *string) *FieldTypeCreate { + if v != nil { + _c.SetPassword(*v) + } + return _c +} + +// SetStringScanner sets the "string_scanner" field. +func (_c *FieldTypeCreate) SetStringScanner(v schema.StringScanner) *FieldTypeCreate { + _c.mutation.SetStringScanner(v) + return _c +} + +// SetNillableStringScanner sets the "string_scanner" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableStringScanner(v *schema.StringScanner) *FieldTypeCreate { + if v != nil { + _c.SetStringScanner(*v) + } + return _c +} + +// SetDuration sets the "duration" field. +func (_c *FieldTypeCreate) SetDuration(v time.Duration) *FieldTypeCreate { + _c.mutation.SetDuration(v) + return _c +} + +// SetNillableDuration sets the "duration" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableDuration(v *time.Duration) *FieldTypeCreate { + if v != nil { + _c.SetDuration(*v) + } + return _c +} + +// SetDir sets the "dir" field. +func (_c *FieldTypeCreate) SetDir(v http.Dir) *FieldTypeCreate { + _c.mutation.SetDir(v) + return _c +} + +// SetNillableDir sets the "dir" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableDir(v *http.Dir) *FieldTypeCreate { + if v != nil { + _c.SetDir(*v) + } + return _c +} + +// SetNdir sets the "ndir" field. +func (_c *FieldTypeCreate) SetNdir(v http.Dir) *FieldTypeCreate { + _c.mutation.SetNdir(v) + return _c +} + +// SetNillableNdir sets the "ndir" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableNdir(v *http.Dir) *FieldTypeCreate { + if v != nil { + _c.SetNdir(*v) + } + return _c +} + +// SetStr sets the "str" field. +func (_c *FieldTypeCreate) SetStr(v sql.NullString) *FieldTypeCreate { + _c.mutation.SetStr(v) + return _c +} + +// SetNillableStr sets the "str" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableStr(v *sql.NullString) *FieldTypeCreate { + if v != nil { + _c.SetStr(*v) + } + return _c +} + +// SetNullStr sets the "null_str" field. +func (_c *FieldTypeCreate) SetNullStr(v *sql.NullString) *FieldTypeCreate { + _c.mutation.SetNullStr(v) + return _c +} + +// SetLink sets the "link" field. +func (_c *FieldTypeCreate) SetLink(v schema.Link) *FieldTypeCreate { + _c.mutation.SetLink(v) + return _c +} + +// SetNillableLink sets the "link" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableLink(v *schema.Link) *FieldTypeCreate { + if v != nil { + _c.SetLink(*v) + } + return _c +} + +// SetNullLink sets the "null_link" field. +func (_c *FieldTypeCreate) SetNullLink(v *schema.Link) *FieldTypeCreate { + _c.mutation.SetNullLink(v) + return _c +} + +// SetActive sets the "active" field. +func (_c *FieldTypeCreate) SetActive(v schema.Status) *FieldTypeCreate { + _c.mutation.SetActive(v) + return _c +} + +// SetNillableActive sets the "active" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableActive(v *schema.Status) *FieldTypeCreate { + if v != nil { + _c.SetActive(*v) + } + return _c +} + +// SetNullActive sets the "null_active" field. +func (_c *FieldTypeCreate) SetNullActive(v schema.Status) *FieldTypeCreate { + _c.mutation.SetNullActive(v) + return _c +} + +// SetNillableNullActive sets the "null_active" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableNullActive(v *schema.Status) *FieldTypeCreate { + if v != nil { + _c.SetNullActive(*v) + } + return _c +} + +// SetDeleted sets the "deleted" field. +func (_c *FieldTypeCreate) SetDeleted(v *sql.NullBool) *FieldTypeCreate { + _c.mutation.SetDeleted(v) + return _c +} + +// SetDeletedAt sets the "deleted_at" field. +func (_c *FieldTypeCreate) SetDeletedAt(v *sql.NullTime) *FieldTypeCreate { + _c.mutation.SetDeletedAt(v) + return _c +} + +// SetRawData sets the "raw_data" field. +func (_c *FieldTypeCreate) SetRawData(v []byte) *FieldTypeCreate { + _c.mutation.SetRawData(v) + return _c +} + +// SetSensitive sets the "sensitive" field. +func (_c *FieldTypeCreate) SetSensitive(v []byte) *FieldTypeCreate { + _c.mutation.SetSensitive(v) + return _c +} + +// SetIP sets the "ip" field. +func (_c *FieldTypeCreate) SetIP(v net.IP) *FieldTypeCreate { + _c.mutation.SetIP(v) + return _c +} + +// SetNullInt64 sets the "null_int64" field. +func (_c *FieldTypeCreate) SetNullInt64(v *sql.NullInt64) *FieldTypeCreate { + _c.mutation.SetNullInt64(v) + return _c +} + +// SetSchemaInt sets the "schema_int" field. +func (_c *FieldTypeCreate) SetSchemaInt(v schema.Int) *FieldTypeCreate { + _c.mutation.SetSchemaInt(v) + return _c +} + +// SetNillableSchemaInt sets the "schema_int" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableSchemaInt(v *schema.Int) *FieldTypeCreate { + if v != nil { + _c.SetSchemaInt(*v) + } + return _c +} + +// SetSchemaInt8 sets the "schema_int8" field. +func (_c *FieldTypeCreate) SetSchemaInt8(v schema.Int8) *FieldTypeCreate { + _c.mutation.SetSchemaInt8(v) + return _c +} + +// SetNillableSchemaInt8 sets the "schema_int8" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableSchemaInt8(v *schema.Int8) *FieldTypeCreate { + if v != nil { + _c.SetSchemaInt8(*v) + } + return _c +} + +// SetSchemaInt64 sets the "schema_int64" field. +func (_c *FieldTypeCreate) SetSchemaInt64(v schema.Int64) *FieldTypeCreate { + _c.mutation.SetSchemaInt64(v) + return _c +} + +// SetNillableSchemaInt64 sets the "schema_int64" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableSchemaInt64(v *schema.Int64) *FieldTypeCreate { + if v != nil { + _c.SetSchemaInt64(*v) + } + return _c +} + +// SetSchemaFloat sets the "schema_float" field. +func (_c *FieldTypeCreate) SetSchemaFloat(v schema.Float64) *FieldTypeCreate { + _c.mutation.SetSchemaFloat(v) + return _c +} + +// SetNillableSchemaFloat sets the "schema_float" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableSchemaFloat(v *schema.Float64) *FieldTypeCreate { + if v != nil { + _c.SetSchemaFloat(*v) + } + return _c +} + +// SetSchemaFloat32 sets the "schema_float32" field. +func (_c *FieldTypeCreate) SetSchemaFloat32(v schema.Float32) *FieldTypeCreate { + _c.mutation.SetSchemaFloat32(v) + return _c +} + +// SetNillableSchemaFloat32 sets the "schema_float32" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableSchemaFloat32(v *schema.Float32) *FieldTypeCreate { + if v != nil { + _c.SetSchemaFloat32(*v) + } + return _c +} + +// SetNullFloat sets the "null_float" field. +func (_c *FieldTypeCreate) SetNullFloat(v *sql.NullFloat64) *FieldTypeCreate { + _c.mutation.SetNullFloat(v) + return _c +} + +// SetRole sets the "role" field. +func (_c *FieldTypeCreate) SetRole(v role.Role) *FieldTypeCreate { + _c.mutation.SetRole(v) + return _c +} + +// SetNillableRole sets the "role" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableRole(v *role.Role) *FieldTypeCreate { + if v != nil { + _c.SetRole(*v) + } + return _c +} + +// SetPriority sets the "priority" field. +func (_c *FieldTypeCreate) SetPriority(v role.Priority) *FieldTypeCreate { + _c.mutation.SetPriority(v) + return _c +} + +// SetNillablePriority sets the "priority" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillablePriority(v *role.Priority) *FieldTypeCreate { + if v != nil { + _c.SetPriority(*v) + } + return _c +} + +// SetOptionalUUID sets the "optional_uuid" field. +func (_c *FieldTypeCreate) SetOptionalUUID(v uuid.UUID) *FieldTypeCreate { + _c.mutation.SetOptionalUUID(v) + return _c +} + +// SetNillableOptionalUUID sets the "optional_uuid" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableOptionalUUID(v *uuid.UUID) *FieldTypeCreate { + if v != nil { + _c.SetOptionalUUID(*v) + } + return _c +} + +// SetNillableUUID sets the "nillable_uuid" field. +func (_c *FieldTypeCreate) SetNillableUUID(v uuid.UUID) *FieldTypeCreate { + _c.mutation.SetNillableUUID(v) + return _c +} + +// SetNillableNillableUUID sets the "nillable_uuid" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableNillableUUID(v *uuid.UUID) *FieldTypeCreate { + if v != nil { + _c.SetNillableUUID(*v) + } + return _c +} + +// SetStrings sets the "strings" field. +func (_c *FieldTypeCreate) SetStrings(v []string) *FieldTypeCreate { + _c.mutation.SetStrings(v) + return _c +} + +// SetPair sets the "pair" field. +func (_c *FieldTypeCreate) SetPair(v schema.Pair) *FieldTypeCreate { + _c.mutation.SetPair(v) + return _c +} + +// SetNillablePair sets the "pair" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillablePair(v *schema.Pair) *FieldTypeCreate { + if v != nil { + _c.SetPair(*v) + } + return _c +} + +// SetNilPair sets the "nil_pair" field. +func (_c *FieldTypeCreate) SetNilPair(v *schema.Pair) *FieldTypeCreate { + _c.mutation.SetNilPair(v) + return _c +} + +// SetVstring sets the "vstring" field. +func (_c *FieldTypeCreate) SetVstring(v schema.VString) *FieldTypeCreate { + _c.mutation.SetVstring(v) + return _c +} + +// SetNillableVstring sets the "vstring" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableVstring(v *schema.VString) *FieldTypeCreate { + if v != nil { + _c.SetVstring(*v) + } + return _c +} + +// SetTriple sets the "triple" field. +func (_c *FieldTypeCreate) SetTriple(v schema.Triple) *FieldTypeCreate { + _c.mutation.SetTriple(v) + return _c +} + +// SetNillableTriple sets the "triple" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableTriple(v *schema.Triple) *FieldTypeCreate { + if v != nil { + _c.SetTriple(*v) + } + return _c +} + +// SetBigInt sets the "big_int" field. +func (_c *FieldTypeCreate) SetBigInt(v schema.BigInt) *FieldTypeCreate { + _c.mutation.SetBigInt(v) + return _c +} + +// SetNillableBigInt sets the "big_int" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillableBigInt(v *schema.BigInt) *FieldTypeCreate { + if v != nil { + _c.SetBigInt(*v) + } + return _c +} + +// SetPasswordOther sets the "password_other" field. +func (_c *FieldTypeCreate) SetPasswordOther(v schema.Password) *FieldTypeCreate { + _c.mutation.SetPasswordOther(v) + return _c +} + +// SetNillablePasswordOther sets the "password_other" field if the given value is not nil. +func (_c *FieldTypeCreate) SetNillablePasswordOther(v *schema.Password) *FieldTypeCreate { + if v != nil { + _c.SetPasswordOther(*v) + } + return _c +} + +// Mutation returns the FieldTypeMutation object of the builder. +func (_c *FieldTypeCreate) Mutation() *FieldTypeMutation { + return _c.mutation +} + +// Save creates the FieldType in the database. +func (_c *FieldTypeCreate) Save(ctx context.Context) (*FieldType, error) { + _c.defaults() + return withHooks(ctx, _c.sqlSave, _c.mutation, _c.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (_c *FieldTypeCreate) SaveX(ctx context.Context) *FieldType { + v, err := _c.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (_c *FieldTypeCreate) Exec(ctx context.Context) error { + _, err := _c.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (_c *FieldTypeCreate) ExecX(ctx context.Context) { + if err := _c.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (_c *FieldTypeCreate) defaults() { + if _, ok := _c.mutation.LinkOther(); !ok { + v := fieldtype.DefaultLinkOther + _c.mutation.SetLinkOther(v) + } + if _, ok := _c.mutation.LinkOtherFunc(); !ok { + v := fieldtype.DefaultLinkOtherFunc() + _c.mutation.SetLinkOtherFunc(v) + } + if _, ok := _c.mutation.Dir(); !ok { + v := fieldtype.DefaultDir() + _c.mutation.SetDir(v) + } + if _, ok := _c.mutation.Str(); !ok { + v := fieldtype.DefaultStr() + _c.mutation.SetStr(v) + } + if _, ok := _c.mutation.NullStr(); !ok { + v := fieldtype.DefaultNullStr() + _c.mutation.SetNullStr(v) + } + if _, ok := _c.mutation.DeletedAt(); !ok { + v := fieldtype.DefaultDeletedAt() + _c.mutation.SetDeletedAt(v) + } + if _, ok := _c.mutation.IP(); !ok { + v := fieldtype.DefaultIP() + _c.mutation.SetIP(v) + } + if _, ok := _c.mutation.Role(); !ok { + v := fieldtype.DefaultRole + _c.mutation.SetRole(v) + } + if _, ok := _c.mutation.Pair(); !ok { + v := fieldtype.DefaultPair() + _c.mutation.SetPair(v) + } + if _, ok := _c.mutation.Vstring(); !ok { + v := fieldtype.DefaultVstring() + _c.mutation.SetVstring(v) + } + if _, ok := _c.mutation.Triple(); !ok { + v := fieldtype.DefaultTriple() + _c.mutation.SetTriple(v) + } +} + +// check runs all checks and user-defined validators on the builder. +func (_c *FieldTypeCreate) check() error { + if _, ok := _c.mutation.Int(); !ok { + return &ValidationError{Name: "int", err: errors.New(`ent: missing required field "FieldType.int"`)} + } + if _, ok := _c.mutation.Int8(); !ok { + return &ValidationError{Name: "int8", err: errors.New(`ent: missing required field "FieldType.int8"`)} + } + if _, ok := _c.mutation.Int16(); !ok { + return &ValidationError{Name: "int16", err: errors.New(`ent: missing required field "FieldType.int16"`)} + } + if _, ok := _c.mutation.Int32(); !ok { + return &ValidationError{Name: "int32", err: errors.New(`ent: missing required field "FieldType.int32"`)} + } + if _, ok := _c.mutation.Int64(); !ok { + return &ValidationError{Name: "int64", err: errors.New(`ent: missing required field "FieldType.int64"`)} + } + if v, ok := _c.mutation.ValidateOptionalInt32(); ok { + if err := fieldtype.ValidateOptionalInt32Validator(v); err != nil { + return &ValidationError{Name: "validate_optional_int32", err: fmt.Errorf(`ent: validator failed for field "FieldType.validate_optional_int32": %w`, err)} + } + } + if v, ok := _c.mutation.State(); ok { + if err := fieldtype.StateValidator(v); err != nil { + return &ValidationError{Name: "state", err: fmt.Errorf(`ent: validator failed for field "FieldType.state": %w`, err)} + } + } + if v, ok := _c.mutation.MAC(); ok { + if err := fieldtype.MACValidator(v.String()); err != nil { + return &ValidationError{Name: "mac", err: fmt.Errorf(`ent: validator failed for field "FieldType.mac": %w`, err)} + } + } + if _, ok := _c.mutation.Dir(); !ok { + return &ValidationError{Name: "dir", err: errors.New(`ent: missing required field "FieldType.dir"`)} + } + if v, ok := _c.mutation.Ndir(); ok { + if err := fieldtype.NdirValidator(string(v)); err != nil { + return &ValidationError{Name: "ndir", err: fmt.Errorf(`ent: validator failed for field "FieldType.ndir": %w`, err)} + } + } + if v, ok := _c.mutation.Link(); ok { + if err := fieldtype.LinkValidator(v.String()); err != nil { + return &ValidationError{Name: "link", err: fmt.Errorf(`ent: validator failed for field "FieldType.link": %w`, err)} + } + } + if v, ok := _c.mutation.RawData(); ok { + if err := fieldtype.RawDataValidator(v); err != nil { + return &ValidationError{Name: "raw_data", err: fmt.Errorf(`ent: validator failed for field "FieldType.raw_data": %w`, err)} + } + } + if v, ok := _c.mutation.IP(); ok { + if err := fieldtype.IPValidator([]byte(v)); err != nil { + return &ValidationError{Name: "ip", err: fmt.Errorf(`ent: validator failed for field "FieldType.ip": %w`, err)} + } + } + if _, ok := _c.mutation.Role(); !ok { + return &ValidationError{Name: "role", err: errors.New(`ent: missing required field "FieldType.role"`)} + } + if v, ok := _c.mutation.Role(); ok { + if err := fieldtype.RoleValidator(v); err != nil { + return &ValidationError{Name: "role", err: fmt.Errorf(`ent: validator failed for field "FieldType.role": %w`, err)} + } + } + if v, ok := _c.mutation.Priority(); ok { + if err := fieldtype.PriorityValidator(v); err != nil { + return &ValidationError{Name: "priority", err: fmt.Errorf(`ent: validator failed for field "FieldType.priority": %w`, err)} + } + } + if _, ok := _c.mutation.Pair(); !ok { + return &ValidationError{Name: "pair", err: errors.New(`ent: missing required field "FieldType.pair"`)} + } + if _, ok := _c.mutation.Vstring(); !ok { + return &ValidationError{Name: "vstring", err: errors.New(`ent: missing required field "FieldType.vstring"`)} + } + if _, ok := _c.mutation.Triple(); !ok { + return &ValidationError{Name: "triple", err: errors.New(`ent: missing required field "FieldType.triple"`)} + } + return nil +} + +func (_c *FieldTypeCreate) sqlSave(ctx context.Context) (*FieldType, error) { + if err := _c.check(); err != nil { + return nil, err + } + _node, _spec := _c.createSpec() + if err := sqlgraph.CreateNode(ctx, _c.driver, _spec); err != nil { + if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + id := _spec.ID.Value.(int64) + _node.ID = int(id) + _c.mutation.id = &_node.ID + _c.mutation.done = true + return _node, nil +} + +func (_c *FieldTypeCreate) createSpec() (*FieldType, *sqlgraph.CreateSpec) { + var ( + _node = &FieldType{config: _c.config} + _spec = sqlgraph.NewCreateSpec(fieldtype.Table, sqlgraph.NewFieldSpec(fieldtype.FieldID, field.TypeInt)) + ) + _spec.OnConflict = _c.conflict + if value, ok := _c.mutation.Int(); ok { + _spec.SetField(fieldtype.FieldInt, field.TypeInt, value) + _node.Int = value + } + if value, ok := _c.mutation.Int8(); ok { + _spec.SetField(fieldtype.FieldInt8, field.TypeInt8, value) + _node.Int8 = value + } + if value, ok := _c.mutation.Int16(); ok { + _spec.SetField(fieldtype.FieldInt16, field.TypeInt16, value) + _node.Int16 = value + } + if value, ok := _c.mutation.Int32(); ok { + _spec.SetField(fieldtype.FieldInt32, field.TypeInt32, value) + _node.Int32 = value + } + if value, ok := _c.mutation.Int64(); ok { + _spec.SetField(fieldtype.FieldInt64, field.TypeInt64, value) + _node.Int64 = value + } + if value, ok := _c.mutation.OptionalInt(); ok { + _spec.SetField(fieldtype.FieldOptionalInt, field.TypeInt, value) + _node.OptionalInt = value + } + if value, ok := _c.mutation.OptionalInt8(); ok { + _spec.SetField(fieldtype.FieldOptionalInt8, field.TypeInt8, value) + _node.OptionalInt8 = value + } + if value, ok := _c.mutation.OptionalInt16(); ok { + _spec.SetField(fieldtype.FieldOptionalInt16, field.TypeInt16, value) + _node.OptionalInt16 = value + } + if value, ok := _c.mutation.OptionalInt32(); ok { + _spec.SetField(fieldtype.FieldOptionalInt32, field.TypeInt32, value) + _node.OptionalInt32 = value + } + if value, ok := _c.mutation.OptionalInt64(); ok { + _spec.SetField(fieldtype.FieldOptionalInt64, field.TypeInt64, value) + _node.OptionalInt64 = value + } + if value, ok := _c.mutation.NillableInt(); ok { + _spec.SetField(fieldtype.FieldNillableInt, field.TypeInt, value) + _node.NillableInt = &value + } + if value, ok := _c.mutation.NillableInt8(); ok { + _spec.SetField(fieldtype.FieldNillableInt8, field.TypeInt8, value) + _node.NillableInt8 = &value + } + if value, ok := _c.mutation.NillableInt16(); ok { + _spec.SetField(fieldtype.FieldNillableInt16, field.TypeInt16, value) + _node.NillableInt16 = &value + } + if value, ok := _c.mutation.NillableInt32(); ok { + _spec.SetField(fieldtype.FieldNillableInt32, field.TypeInt32, value) + _node.NillableInt32 = &value + } + if value, ok := _c.mutation.NillableInt64(); ok { + _spec.SetField(fieldtype.FieldNillableInt64, field.TypeInt64, value) + _node.NillableInt64 = &value + } + if value, ok := _c.mutation.ValidateOptionalInt32(); ok { + _spec.SetField(fieldtype.FieldValidateOptionalInt32, field.TypeInt32, value) + _node.ValidateOptionalInt32 = value + } + if value, ok := _c.mutation.OptionalUint(); ok { + _spec.SetField(fieldtype.FieldOptionalUint, field.TypeUint, value) + _node.OptionalUint = value + } + if value, ok := _c.mutation.OptionalUint8(); ok { + _spec.SetField(fieldtype.FieldOptionalUint8, field.TypeUint8, value) + _node.OptionalUint8 = value + } + if value, ok := _c.mutation.OptionalUint16(); ok { + _spec.SetField(fieldtype.FieldOptionalUint16, field.TypeUint16, value) + _node.OptionalUint16 = value + } + if value, ok := _c.mutation.OptionalUint32(); ok { + _spec.SetField(fieldtype.FieldOptionalUint32, field.TypeUint32, value) + _node.OptionalUint32 = value + } + if value, ok := _c.mutation.OptionalUint64(); ok { + _spec.SetField(fieldtype.FieldOptionalUint64, field.TypeUint64, value) + _node.OptionalUint64 = value + } + if value, ok := _c.mutation.State(); ok { + _spec.SetField(fieldtype.FieldState, field.TypeEnum, value) + _node.State = value + } + if value, ok := _c.mutation.OptionalFloat(); ok { + _spec.SetField(fieldtype.FieldOptionalFloat, field.TypeFloat64, value) + _node.OptionalFloat = value + } + if value, ok := _c.mutation.OptionalFloat32(); ok { + _spec.SetField(fieldtype.FieldOptionalFloat32, field.TypeFloat32, value) + _node.OptionalFloat32 = value + } + if value, ok := _c.mutation.Text(); ok { + _spec.SetField(fieldtype.FieldText, field.TypeString, value) + _node.Text = value + } + if value, ok := _c.mutation.Datetime(); ok { + _spec.SetField(fieldtype.FieldDatetime, field.TypeTime, value) + _node.Datetime = value + } + if value, ok := _c.mutation.Decimal(); ok { + _spec.SetField(fieldtype.FieldDecimal, field.TypeFloat64, value) + _node.Decimal = value + } + if value, ok := _c.mutation.LinkOther(); ok { + _spec.SetField(fieldtype.FieldLinkOther, field.TypeOther, value) + _node.LinkOther = value + } + if value, ok := _c.mutation.LinkOtherFunc(); ok { + _spec.SetField(fieldtype.FieldLinkOtherFunc, field.TypeOther, value) + _node.LinkOtherFunc = value + } + if value, ok := _c.mutation.MAC(); ok { + _spec.SetField(fieldtype.FieldMAC, field.TypeString, value) + _node.MAC = value + } + if value, ok := _c.mutation.StringArray(); ok { + _spec.SetField(fieldtype.FieldStringArray, field.TypeOther, value) + _node.StringArray = value + } + if value, ok := _c.mutation.Password(); ok { + _spec.SetField(fieldtype.FieldPassword, field.TypeString, value) + _node.Password = value + } + if value, ok := _c.mutation.StringScanner(); ok { + _spec.SetField(fieldtype.FieldStringScanner, field.TypeString, value) + _node.StringScanner = &value + } + if value, ok := _c.mutation.Duration(); ok { + _spec.SetField(fieldtype.FieldDuration, field.TypeInt64, value) + _node.Duration = value + } + if value, ok := _c.mutation.Dir(); ok { + _spec.SetField(fieldtype.FieldDir, field.TypeString, value) + _node.Dir = value + } + if value, ok := _c.mutation.Ndir(); ok { + _spec.SetField(fieldtype.FieldNdir, field.TypeString, value) + _node.Ndir = &value + } + if value, ok := _c.mutation.Str(); ok { + _spec.SetField(fieldtype.FieldStr, field.TypeString, value) + _node.Str = value + } + if value, ok := _c.mutation.NullStr(); ok { + _spec.SetField(fieldtype.FieldNullStr, field.TypeString, value) + _node.NullStr = value + } + if value, ok := _c.mutation.Link(); ok { + _spec.SetField(fieldtype.FieldLink, field.TypeString, value) + _node.Link = value + } + if value, ok := _c.mutation.NullLink(); ok { + _spec.SetField(fieldtype.FieldNullLink, field.TypeString, value) + _node.NullLink = value + } + if value, ok := _c.mutation.Active(); ok { + _spec.SetField(fieldtype.FieldActive, field.TypeBool, value) + _node.Active = value + } + if value, ok := _c.mutation.NullActive(); ok { + _spec.SetField(fieldtype.FieldNullActive, field.TypeBool, value) + _node.NullActive = &value + } + if value, ok := _c.mutation.Deleted(); ok { + _spec.SetField(fieldtype.FieldDeleted, field.TypeBool, value) + _node.Deleted = value + } + if value, ok := _c.mutation.DeletedAt(); ok { + _spec.SetField(fieldtype.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := _c.mutation.RawData(); ok { + _spec.SetField(fieldtype.FieldRawData, field.TypeBytes, value) + _node.RawData = value + } + if value, ok := _c.mutation.Sensitive(); ok { + _spec.SetField(fieldtype.FieldSensitive, field.TypeBytes, value) + _node.Sensitive = value + } + if value, ok := _c.mutation.IP(); ok { + _spec.SetField(fieldtype.FieldIP, field.TypeBytes, value) + _node.IP = value + } + if value, ok := _c.mutation.NullInt64(); ok { + _spec.SetField(fieldtype.FieldNullInt64, field.TypeInt, value) + _node.NullInt64 = value + } + if value, ok := _c.mutation.SchemaInt(); ok { + _spec.SetField(fieldtype.FieldSchemaInt, field.TypeInt, value) + _node.SchemaInt = value + } + if value, ok := _c.mutation.SchemaInt8(); ok { + _spec.SetField(fieldtype.FieldSchemaInt8, field.TypeInt8, value) + _node.SchemaInt8 = value + } + if value, ok := _c.mutation.SchemaInt64(); ok { + _spec.SetField(fieldtype.FieldSchemaInt64, field.TypeInt64, value) + _node.SchemaInt64 = value + } + if value, ok := _c.mutation.SchemaFloat(); ok { + _spec.SetField(fieldtype.FieldSchemaFloat, field.TypeFloat64, value) + _node.SchemaFloat = value + } + if value, ok := _c.mutation.SchemaFloat32(); ok { + _spec.SetField(fieldtype.FieldSchemaFloat32, field.TypeFloat32, value) + _node.SchemaFloat32 = value + } + if value, ok := _c.mutation.NullFloat(); ok { + _spec.SetField(fieldtype.FieldNullFloat, field.TypeFloat64, value) + _node.NullFloat = value + } + if value, ok := _c.mutation.Role(); ok { + _spec.SetField(fieldtype.FieldRole, field.TypeEnum, value) + _node.Role = value + } + if value, ok := _c.mutation.Priority(); ok { + _spec.SetField(fieldtype.FieldPriority, field.TypeEnum, value) + _node.Priority = value + } + if value, ok := _c.mutation.OptionalUUID(); ok { + _spec.SetField(fieldtype.FieldOptionalUUID, field.TypeUUID, value) + _node.OptionalUUID = value + } + if value, ok := _c.mutation.NillableUUID(); ok { + _spec.SetField(fieldtype.FieldNillableUUID, field.TypeUUID, value) + _node.NillableUUID = &value + } + if value, ok := _c.mutation.Strings(); ok { + _spec.SetField(fieldtype.FieldStrings, field.TypeJSON, value) + _node.Strings = value + } + if value, ok := _c.mutation.Pair(); ok { + _spec.SetField(fieldtype.FieldPair, field.TypeBytes, value) + _node.Pair = value + } + if value, ok := _c.mutation.NilPair(); ok { + _spec.SetField(fieldtype.FieldNilPair, field.TypeBytes, value) + _node.NilPair = value + } + if value, ok := _c.mutation.Vstring(); ok { + _spec.SetField(fieldtype.FieldVstring, field.TypeString, value) + _node.Vstring = value + } + if value, ok := _c.mutation.Triple(); ok { + _spec.SetField(fieldtype.FieldTriple, field.TypeString, value) + _node.Triple = value + } + if value, ok := _c.mutation.BigInt(); ok { + _spec.SetField(fieldtype.FieldBigInt, field.TypeInt, value) + _node.BigInt = value + } + if value, ok := _c.mutation.PasswordOther(); ok { + _spec.SetField(fieldtype.FieldPasswordOther, field.TypeOther, value) + _node.PasswordOther = value + } + return _node, _spec +} + +// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause +// of the `INSERT` statement. For example: +// +// client.FieldType.Create(). +// SetInt(v). +// OnConflict( +// // Update the row with the new values +// // the was proposed for insertion. +// sql.ResolveWithNewValues(), +// ). +// // Override some of the fields with custom +// // update values. +// Update(func(u *ent.FieldTypeUpsert) { +// SetInt(v+v). +// }). +// Exec(ctx) +func (_c *FieldTypeCreate) OnConflict(opts ...sql.ConflictOption) *FieldTypeUpsertOne { + _c.conflict = opts + return &FieldTypeUpsertOne{ + create: _c, + } +} + +// OnConflictColumns calls `OnConflict` and configures the columns +// as conflict target. Using this option is equivalent to using: +// +// client.FieldType.Create(). +// OnConflict(sql.ConflictColumns(columns...)). +// Exec(ctx) +func (_c *FieldTypeCreate) OnConflictColumns(columns ...string) *FieldTypeUpsertOne { + _c.conflict = append(_c.conflict, sql.ConflictColumns(columns...)) + return &FieldTypeUpsertOne{ + create: _c, + } +} + +type ( + // FieldTypeUpsertOne is the builder for "upsert"-ing + // one FieldType node. + FieldTypeUpsertOne struct { + create *FieldTypeCreate + } + + // FieldTypeUpsert is the "OnConflict" setter. + FieldTypeUpsert struct { + *sql.UpdateSet + } +) + +// SetInt sets the "int" field. +func (u *FieldTypeUpsert) SetInt(v int) *FieldTypeUpsert { + u.Set(fieldtype.FieldInt, v) + return u +} + +// UpdateInt sets the "int" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateInt() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldInt) + return u +} + +// AddInt adds v to the "int" field. +func (u *FieldTypeUpsert) AddInt(v int) *FieldTypeUpsert { + u.Add(fieldtype.FieldInt, v) + return u +} + +// SetInt8 sets the "int8" field. +func (u *FieldTypeUpsert) SetInt8(v int8) *FieldTypeUpsert { + u.Set(fieldtype.FieldInt8, v) + return u +} + +// UpdateInt8 sets the "int8" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateInt8() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldInt8) + return u +} + +// AddInt8 adds v to the "int8" field. +func (u *FieldTypeUpsert) AddInt8(v int8) *FieldTypeUpsert { + u.Add(fieldtype.FieldInt8, v) + return u +} + +// SetInt16 sets the "int16" field. +func (u *FieldTypeUpsert) SetInt16(v int16) *FieldTypeUpsert { + u.Set(fieldtype.FieldInt16, v) + return u +} + +// UpdateInt16 sets the "int16" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateInt16() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldInt16) + return u +} + +// AddInt16 adds v to the "int16" field. +func (u *FieldTypeUpsert) AddInt16(v int16) *FieldTypeUpsert { + u.Add(fieldtype.FieldInt16, v) + return u +} + +// SetInt32 sets the "int32" field. +func (u *FieldTypeUpsert) SetInt32(v int32) *FieldTypeUpsert { + u.Set(fieldtype.FieldInt32, v) + return u +} + +// UpdateInt32 sets the "int32" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateInt32() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldInt32) + return u +} + +// AddInt32 adds v to the "int32" field. +func (u *FieldTypeUpsert) AddInt32(v int32) *FieldTypeUpsert { + u.Add(fieldtype.FieldInt32, v) + return u +} + +// SetInt64 sets the "int64" field. +func (u *FieldTypeUpsert) SetInt64(v int64) *FieldTypeUpsert { + u.Set(fieldtype.FieldInt64, v) + return u +} + +// UpdateInt64 sets the "int64" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateInt64() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldInt64) + return u +} + +// AddInt64 adds v to the "int64" field. +func (u *FieldTypeUpsert) AddInt64(v int64) *FieldTypeUpsert { + u.Add(fieldtype.FieldInt64, v) + return u +} + +// SetOptionalInt sets the "optional_int" field. +func (u *FieldTypeUpsert) SetOptionalInt(v int) *FieldTypeUpsert { + u.Set(fieldtype.FieldOptionalInt, v) + return u +} + +// UpdateOptionalInt sets the "optional_int" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateOptionalInt() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldOptionalInt) + return u +} + +// AddOptionalInt adds v to the "optional_int" field. +func (u *FieldTypeUpsert) AddOptionalInt(v int) *FieldTypeUpsert { + u.Add(fieldtype.FieldOptionalInt, v) + return u +} + +// ClearOptionalInt clears the value of the "optional_int" field. +func (u *FieldTypeUpsert) ClearOptionalInt() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldOptionalInt) + return u +} + +// SetOptionalInt8 sets the "optional_int8" field. +func (u *FieldTypeUpsert) SetOptionalInt8(v int8) *FieldTypeUpsert { + u.Set(fieldtype.FieldOptionalInt8, v) + return u +} + +// UpdateOptionalInt8 sets the "optional_int8" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateOptionalInt8() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldOptionalInt8) + return u +} + +// AddOptionalInt8 adds v to the "optional_int8" field. +func (u *FieldTypeUpsert) AddOptionalInt8(v int8) *FieldTypeUpsert { + u.Add(fieldtype.FieldOptionalInt8, v) + return u +} + +// ClearOptionalInt8 clears the value of the "optional_int8" field. +func (u *FieldTypeUpsert) ClearOptionalInt8() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldOptionalInt8) + return u +} + +// SetOptionalInt16 sets the "optional_int16" field. +func (u *FieldTypeUpsert) SetOptionalInt16(v int16) *FieldTypeUpsert { + u.Set(fieldtype.FieldOptionalInt16, v) + return u +} + +// UpdateOptionalInt16 sets the "optional_int16" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateOptionalInt16() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldOptionalInt16) + return u +} + +// AddOptionalInt16 adds v to the "optional_int16" field. +func (u *FieldTypeUpsert) AddOptionalInt16(v int16) *FieldTypeUpsert { + u.Add(fieldtype.FieldOptionalInt16, v) + return u +} + +// ClearOptionalInt16 clears the value of the "optional_int16" field. +func (u *FieldTypeUpsert) ClearOptionalInt16() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldOptionalInt16) + return u +} + +// SetOptionalInt32 sets the "optional_int32" field. +func (u *FieldTypeUpsert) SetOptionalInt32(v int32) *FieldTypeUpsert { + u.Set(fieldtype.FieldOptionalInt32, v) + return u +} + +// UpdateOptionalInt32 sets the "optional_int32" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateOptionalInt32() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldOptionalInt32) + return u +} + +// AddOptionalInt32 adds v to the "optional_int32" field. +func (u *FieldTypeUpsert) AddOptionalInt32(v int32) *FieldTypeUpsert { + u.Add(fieldtype.FieldOptionalInt32, v) + return u +} + +// ClearOptionalInt32 clears the value of the "optional_int32" field. +func (u *FieldTypeUpsert) ClearOptionalInt32() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldOptionalInt32) + return u +} + +// SetOptionalInt64 sets the "optional_int64" field. +func (u *FieldTypeUpsert) SetOptionalInt64(v int64) *FieldTypeUpsert { + u.Set(fieldtype.FieldOptionalInt64, v) + return u +} + +// UpdateOptionalInt64 sets the "optional_int64" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateOptionalInt64() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldOptionalInt64) + return u +} + +// AddOptionalInt64 adds v to the "optional_int64" field. +func (u *FieldTypeUpsert) AddOptionalInt64(v int64) *FieldTypeUpsert { + u.Add(fieldtype.FieldOptionalInt64, v) + return u +} + +// ClearOptionalInt64 clears the value of the "optional_int64" field. +func (u *FieldTypeUpsert) ClearOptionalInt64() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldOptionalInt64) + return u +} + +// SetNillableInt sets the "nillable_int" field. +func (u *FieldTypeUpsert) SetNillableInt(v int) *FieldTypeUpsert { + u.Set(fieldtype.FieldNillableInt, v) + return u +} + +// UpdateNillableInt sets the "nillable_int" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateNillableInt() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldNillableInt) + return u +} + +// AddNillableInt adds v to the "nillable_int" field. +func (u *FieldTypeUpsert) AddNillableInt(v int) *FieldTypeUpsert { + u.Add(fieldtype.FieldNillableInt, v) + return u +} + +// ClearNillableInt clears the value of the "nillable_int" field. +func (u *FieldTypeUpsert) ClearNillableInt() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldNillableInt) + return u +} + +// SetNillableInt8 sets the "nillable_int8" field. +func (u *FieldTypeUpsert) SetNillableInt8(v int8) *FieldTypeUpsert { + u.Set(fieldtype.FieldNillableInt8, v) + return u +} + +// UpdateNillableInt8 sets the "nillable_int8" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateNillableInt8() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldNillableInt8) + return u +} + +// AddNillableInt8 adds v to the "nillable_int8" field. +func (u *FieldTypeUpsert) AddNillableInt8(v int8) *FieldTypeUpsert { + u.Add(fieldtype.FieldNillableInt8, v) + return u +} + +// ClearNillableInt8 clears the value of the "nillable_int8" field. +func (u *FieldTypeUpsert) ClearNillableInt8() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldNillableInt8) + return u +} + +// SetNillableInt16 sets the "nillable_int16" field. +func (u *FieldTypeUpsert) SetNillableInt16(v int16) *FieldTypeUpsert { + u.Set(fieldtype.FieldNillableInt16, v) + return u +} + +// UpdateNillableInt16 sets the "nillable_int16" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateNillableInt16() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldNillableInt16) + return u +} + +// AddNillableInt16 adds v to the "nillable_int16" field. +func (u *FieldTypeUpsert) AddNillableInt16(v int16) *FieldTypeUpsert { + u.Add(fieldtype.FieldNillableInt16, v) + return u +} + +// ClearNillableInt16 clears the value of the "nillable_int16" field. +func (u *FieldTypeUpsert) ClearNillableInt16() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldNillableInt16) + return u +} + +// SetNillableInt32 sets the "nillable_int32" field. +func (u *FieldTypeUpsert) SetNillableInt32(v int32) *FieldTypeUpsert { + u.Set(fieldtype.FieldNillableInt32, v) + return u +} + +// UpdateNillableInt32 sets the "nillable_int32" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateNillableInt32() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldNillableInt32) + return u +} + +// AddNillableInt32 adds v to the "nillable_int32" field. +func (u *FieldTypeUpsert) AddNillableInt32(v int32) *FieldTypeUpsert { + u.Add(fieldtype.FieldNillableInt32, v) + return u +} + +// ClearNillableInt32 clears the value of the "nillable_int32" field. +func (u *FieldTypeUpsert) ClearNillableInt32() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldNillableInt32) + return u +} + +// SetNillableInt64 sets the "nillable_int64" field. +func (u *FieldTypeUpsert) SetNillableInt64(v int64) *FieldTypeUpsert { + u.Set(fieldtype.FieldNillableInt64, v) + return u +} + +// UpdateNillableInt64 sets the "nillable_int64" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateNillableInt64() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldNillableInt64) + return u +} + +// AddNillableInt64 adds v to the "nillable_int64" field. +func (u *FieldTypeUpsert) AddNillableInt64(v int64) *FieldTypeUpsert { + u.Add(fieldtype.FieldNillableInt64, v) + return u +} + +// ClearNillableInt64 clears the value of the "nillable_int64" field. +func (u *FieldTypeUpsert) ClearNillableInt64() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldNillableInt64) + return u +} + +// SetValidateOptionalInt32 sets the "validate_optional_int32" field. +func (u *FieldTypeUpsert) SetValidateOptionalInt32(v int32) *FieldTypeUpsert { + u.Set(fieldtype.FieldValidateOptionalInt32, v) + return u +} + +// UpdateValidateOptionalInt32 sets the "validate_optional_int32" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateValidateOptionalInt32() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldValidateOptionalInt32) + return u +} + +// AddValidateOptionalInt32 adds v to the "validate_optional_int32" field. +func (u *FieldTypeUpsert) AddValidateOptionalInt32(v int32) *FieldTypeUpsert { + u.Add(fieldtype.FieldValidateOptionalInt32, v) + return u +} + +// ClearValidateOptionalInt32 clears the value of the "validate_optional_int32" field. +func (u *FieldTypeUpsert) ClearValidateOptionalInt32() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldValidateOptionalInt32) + return u +} + +// SetOptionalUint sets the "optional_uint" field. +func (u *FieldTypeUpsert) SetOptionalUint(v uint) *FieldTypeUpsert { + u.Set(fieldtype.FieldOptionalUint, v) + return u +} + +// UpdateOptionalUint sets the "optional_uint" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateOptionalUint() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldOptionalUint) + return u +} + +// AddOptionalUint adds v to the "optional_uint" field. +func (u *FieldTypeUpsert) AddOptionalUint(v uint) *FieldTypeUpsert { + u.Add(fieldtype.FieldOptionalUint, v) + return u +} + +// ClearOptionalUint clears the value of the "optional_uint" field. +func (u *FieldTypeUpsert) ClearOptionalUint() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldOptionalUint) + return u +} + +// SetOptionalUint8 sets the "optional_uint8" field. +func (u *FieldTypeUpsert) SetOptionalUint8(v uint8) *FieldTypeUpsert { + u.Set(fieldtype.FieldOptionalUint8, v) + return u +} + +// UpdateOptionalUint8 sets the "optional_uint8" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateOptionalUint8() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldOptionalUint8) + return u +} + +// AddOptionalUint8 adds v to the "optional_uint8" field. +func (u *FieldTypeUpsert) AddOptionalUint8(v uint8) *FieldTypeUpsert { + u.Add(fieldtype.FieldOptionalUint8, v) + return u +} + +// ClearOptionalUint8 clears the value of the "optional_uint8" field. +func (u *FieldTypeUpsert) ClearOptionalUint8() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldOptionalUint8) + return u +} + +// SetOptionalUint16 sets the "optional_uint16" field. +func (u *FieldTypeUpsert) SetOptionalUint16(v uint16) *FieldTypeUpsert { + u.Set(fieldtype.FieldOptionalUint16, v) + return u +} + +// UpdateOptionalUint16 sets the "optional_uint16" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateOptionalUint16() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldOptionalUint16) + return u +} + +// AddOptionalUint16 adds v to the "optional_uint16" field. +func (u *FieldTypeUpsert) AddOptionalUint16(v uint16) *FieldTypeUpsert { + u.Add(fieldtype.FieldOptionalUint16, v) + return u +} + +// ClearOptionalUint16 clears the value of the "optional_uint16" field. +func (u *FieldTypeUpsert) ClearOptionalUint16() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldOptionalUint16) + return u +} + +// SetOptionalUint32 sets the "optional_uint32" field. +func (u *FieldTypeUpsert) SetOptionalUint32(v uint32) *FieldTypeUpsert { + u.Set(fieldtype.FieldOptionalUint32, v) + return u +} + +// UpdateOptionalUint32 sets the "optional_uint32" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateOptionalUint32() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldOptionalUint32) + return u +} + +// AddOptionalUint32 adds v to the "optional_uint32" field. +func (u *FieldTypeUpsert) AddOptionalUint32(v uint32) *FieldTypeUpsert { + u.Add(fieldtype.FieldOptionalUint32, v) + return u +} + +// ClearOptionalUint32 clears the value of the "optional_uint32" field. +func (u *FieldTypeUpsert) ClearOptionalUint32() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldOptionalUint32) + return u +} + +// SetOptionalUint64 sets the "optional_uint64" field. +func (u *FieldTypeUpsert) SetOptionalUint64(v uint64) *FieldTypeUpsert { + u.Set(fieldtype.FieldOptionalUint64, v) + return u +} + +// UpdateOptionalUint64 sets the "optional_uint64" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateOptionalUint64() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldOptionalUint64) + return u +} + +// AddOptionalUint64 adds v to the "optional_uint64" field. +func (u *FieldTypeUpsert) AddOptionalUint64(v uint64) *FieldTypeUpsert { + u.Add(fieldtype.FieldOptionalUint64, v) + return u +} + +// ClearOptionalUint64 clears the value of the "optional_uint64" field. +func (u *FieldTypeUpsert) ClearOptionalUint64() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldOptionalUint64) + return u +} + +// SetState sets the "state" field. +func (u *FieldTypeUpsert) SetState(v fieldtype.State) *FieldTypeUpsert { + u.Set(fieldtype.FieldState, v) + return u +} + +// UpdateState sets the "state" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateState() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldState) + return u +} + +// ClearState clears the value of the "state" field. +func (u *FieldTypeUpsert) ClearState() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldState) + return u +} + +// SetOptionalFloat sets the "optional_float" field. +func (u *FieldTypeUpsert) SetOptionalFloat(v float64) *FieldTypeUpsert { + u.Set(fieldtype.FieldOptionalFloat, v) + return u +} + +// UpdateOptionalFloat sets the "optional_float" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateOptionalFloat() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldOptionalFloat) + return u +} + +// AddOptionalFloat adds v to the "optional_float" field. +func (u *FieldTypeUpsert) AddOptionalFloat(v float64) *FieldTypeUpsert { + u.Add(fieldtype.FieldOptionalFloat, v) + return u +} + +// ClearOptionalFloat clears the value of the "optional_float" field. +func (u *FieldTypeUpsert) ClearOptionalFloat() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldOptionalFloat) + return u +} + +// SetOptionalFloat32 sets the "optional_float32" field. +func (u *FieldTypeUpsert) SetOptionalFloat32(v float32) *FieldTypeUpsert { + u.Set(fieldtype.FieldOptionalFloat32, v) + return u +} + +// UpdateOptionalFloat32 sets the "optional_float32" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateOptionalFloat32() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldOptionalFloat32) + return u +} + +// AddOptionalFloat32 adds v to the "optional_float32" field. +func (u *FieldTypeUpsert) AddOptionalFloat32(v float32) *FieldTypeUpsert { + u.Add(fieldtype.FieldOptionalFloat32, v) + return u +} + +// ClearOptionalFloat32 clears the value of the "optional_float32" field. +func (u *FieldTypeUpsert) ClearOptionalFloat32() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldOptionalFloat32) + return u +} + +// SetText sets the "text" field. +func (u *FieldTypeUpsert) SetText(v string) *FieldTypeUpsert { + u.Set(fieldtype.FieldText, v) + return u +} + +// UpdateText sets the "text" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateText() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldText) + return u +} + +// ClearText clears the value of the "text" field. +func (u *FieldTypeUpsert) ClearText() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldText) + return u +} + +// SetDatetime sets the "datetime" field. +func (u *FieldTypeUpsert) SetDatetime(v time.Time) *FieldTypeUpsert { + u.Set(fieldtype.FieldDatetime, v) + return u +} + +// UpdateDatetime sets the "datetime" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateDatetime() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldDatetime) + return u +} + +// ClearDatetime clears the value of the "datetime" field. +func (u *FieldTypeUpsert) ClearDatetime() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldDatetime) + return u +} + +// SetDecimal sets the "decimal" field. +func (u *FieldTypeUpsert) SetDecimal(v float64) *FieldTypeUpsert { + u.Set(fieldtype.FieldDecimal, v) + return u +} + +// UpdateDecimal sets the "decimal" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateDecimal() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldDecimal) + return u +} + +// AddDecimal adds v to the "decimal" field. +func (u *FieldTypeUpsert) AddDecimal(v float64) *FieldTypeUpsert { + u.Add(fieldtype.FieldDecimal, v) + return u +} + +// ClearDecimal clears the value of the "decimal" field. +func (u *FieldTypeUpsert) ClearDecimal() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldDecimal) + return u +} + +// SetLinkOther sets the "link_other" field. +func (u *FieldTypeUpsert) SetLinkOther(v *schema.Link) *FieldTypeUpsert { + u.Set(fieldtype.FieldLinkOther, v) + return u +} + +// UpdateLinkOther sets the "link_other" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateLinkOther() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldLinkOther) + return u +} + +// ClearLinkOther clears the value of the "link_other" field. +func (u *FieldTypeUpsert) ClearLinkOther() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldLinkOther) + return u +} + +// SetLinkOtherFunc sets the "link_other_func" field. +func (u *FieldTypeUpsert) SetLinkOtherFunc(v *schema.Link) *FieldTypeUpsert { + u.Set(fieldtype.FieldLinkOtherFunc, v) + return u +} + +// UpdateLinkOtherFunc sets the "link_other_func" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateLinkOtherFunc() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldLinkOtherFunc) + return u +} + +// ClearLinkOtherFunc clears the value of the "link_other_func" field. +func (u *FieldTypeUpsert) ClearLinkOtherFunc() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldLinkOtherFunc) + return u +} + +// SetMAC sets the "mac" field. +func (u *FieldTypeUpsert) SetMAC(v schema.MAC) *FieldTypeUpsert { + u.Set(fieldtype.FieldMAC, v) + return u +} + +// UpdateMAC sets the "mac" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateMAC() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldMAC) + return u +} + +// ClearMAC clears the value of the "mac" field. +func (u *FieldTypeUpsert) ClearMAC() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldMAC) + return u +} + +// SetStringArray sets the "string_array" field. +func (u *FieldTypeUpsert) SetStringArray(v schema.Strings) *FieldTypeUpsert { + u.Set(fieldtype.FieldStringArray, v) + return u +} + +// UpdateStringArray sets the "string_array" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateStringArray() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldStringArray) + return u +} + +// ClearStringArray clears the value of the "string_array" field. +func (u *FieldTypeUpsert) ClearStringArray() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldStringArray) + return u +} + +// SetPassword sets the "password" field. +func (u *FieldTypeUpsert) SetPassword(v string) *FieldTypeUpsert { + u.Set(fieldtype.FieldPassword, v) + return u +} + +// UpdatePassword sets the "password" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdatePassword() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldPassword) + return u +} + +// ClearPassword clears the value of the "password" field. +func (u *FieldTypeUpsert) ClearPassword() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldPassword) + return u +} + +// SetStringScanner sets the "string_scanner" field. +func (u *FieldTypeUpsert) SetStringScanner(v schema.StringScanner) *FieldTypeUpsert { + u.Set(fieldtype.FieldStringScanner, v) + return u +} + +// UpdateStringScanner sets the "string_scanner" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateStringScanner() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldStringScanner) + return u +} + +// ClearStringScanner clears the value of the "string_scanner" field. +func (u *FieldTypeUpsert) ClearStringScanner() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldStringScanner) + return u +} + +// SetDuration sets the "duration" field. +func (u *FieldTypeUpsert) SetDuration(v time.Duration) *FieldTypeUpsert { + u.Set(fieldtype.FieldDuration, v) + return u +} + +// UpdateDuration sets the "duration" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateDuration() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldDuration) + return u +} + +// AddDuration adds v to the "duration" field. +func (u *FieldTypeUpsert) AddDuration(v time.Duration) *FieldTypeUpsert { + u.Add(fieldtype.FieldDuration, v) + return u +} + +// ClearDuration clears the value of the "duration" field. +func (u *FieldTypeUpsert) ClearDuration() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldDuration) + return u +} + +// SetDir sets the "dir" field. +func (u *FieldTypeUpsert) SetDir(v http.Dir) *FieldTypeUpsert { + u.Set(fieldtype.FieldDir, v) + return u +} + +// UpdateDir sets the "dir" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateDir() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldDir) + return u +} + +// SetNdir sets the "ndir" field. +func (u *FieldTypeUpsert) SetNdir(v http.Dir) *FieldTypeUpsert { + u.Set(fieldtype.FieldNdir, v) + return u +} + +// UpdateNdir sets the "ndir" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateNdir() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldNdir) + return u +} + +// ClearNdir clears the value of the "ndir" field. +func (u *FieldTypeUpsert) ClearNdir() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldNdir) + return u +} + +// SetStr sets the "str" field. +func (u *FieldTypeUpsert) SetStr(v sql.NullString) *FieldTypeUpsert { + u.Set(fieldtype.FieldStr, v) + return u +} + +// UpdateStr sets the "str" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateStr() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldStr) + return u +} + +// ClearStr clears the value of the "str" field. +func (u *FieldTypeUpsert) ClearStr() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldStr) + return u +} + +// SetNullStr sets the "null_str" field. +func (u *FieldTypeUpsert) SetNullStr(v *sql.NullString) *FieldTypeUpsert { + u.Set(fieldtype.FieldNullStr, v) + return u +} + +// UpdateNullStr sets the "null_str" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateNullStr() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldNullStr) + return u +} + +// ClearNullStr clears the value of the "null_str" field. +func (u *FieldTypeUpsert) ClearNullStr() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldNullStr) + return u +} + +// SetLink sets the "link" field. +func (u *FieldTypeUpsert) SetLink(v schema.Link) *FieldTypeUpsert { + u.Set(fieldtype.FieldLink, v) + return u +} + +// UpdateLink sets the "link" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateLink() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldLink) + return u +} + +// ClearLink clears the value of the "link" field. +func (u *FieldTypeUpsert) ClearLink() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldLink) + return u +} + +// SetNullLink sets the "null_link" field. +func (u *FieldTypeUpsert) SetNullLink(v *schema.Link) *FieldTypeUpsert { + u.Set(fieldtype.FieldNullLink, v) + return u +} + +// UpdateNullLink sets the "null_link" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateNullLink() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldNullLink) + return u +} + +// ClearNullLink clears the value of the "null_link" field. +func (u *FieldTypeUpsert) ClearNullLink() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldNullLink) + return u +} + +// SetActive sets the "active" field. +func (u *FieldTypeUpsert) SetActive(v schema.Status) *FieldTypeUpsert { + u.Set(fieldtype.FieldActive, v) + return u +} + +// UpdateActive sets the "active" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateActive() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldActive) + return u +} + +// ClearActive clears the value of the "active" field. +func (u *FieldTypeUpsert) ClearActive() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldActive) + return u +} + +// SetNullActive sets the "null_active" field. +func (u *FieldTypeUpsert) SetNullActive(v schema.Status) *FieldTypeUpsert { + u.Set(fieldtype.FieldNullActive, v) + return u +} + +// UpdateNullActive sets the "null_active" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateNullActive() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldNullActive) + return u +} + +// ClearNullActive clears the value of the "null_active" field. +func (u *FieldTypeUpsert) ClearNullActive() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldNullActive) + return u +} + +// SetDeleted sets the "deleted" field. +func (u *FieldTypeUpsert) SetDeleted(v *sql.NullBool) *FieldTypeUpsert { + u.Set(fieldtype.FieldDeleted, v) + return u +} + +// UpdateDeleted sets the "deleted" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateDeleted() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldDeleted) + return u +} + +// ClearDeleted clears the value of the "deleted" field. +func (u *FieldTypeUpsert) ClearDeleted() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldDeleted) + return u +} + +// SetDeletedAt sets the "deleted_at" field. +func (u *FieldTypeUpsert) SetDeletedAt(v *sql.NullTime) *FieldTypeUpsert { + u.Set(fieldtype.FieldDeletedAt, v) + return u +} + +// UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateDeletedAt() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldDeletedAt) + return u +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (u *FieldTypeUpsert) ClearDeletedAt() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldDeletedAt) + return u +} + +// SetRawData sets the "raw_data" field. +func (u *FieldTypeUpsert) SetRawData(v []byte) *FieldTypeUpsert { + u.Set(fieldtype.FieldRawData, v) + return u +} + +// UpdateRawData sets the "raw_data" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateRawData() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldRawData) + return u +} + +// ClearRawData clears the value of the "raw_data" field. +func (u *FieldTypeUpsert) ClearRawData() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldRawData) + return u +} + +// SetSensitive sets the "sensitive" field. +func (u *FieldTypeUpsert) SetSensitive(v []byte) *FieldTypeUpsert { + u.Set(fieldtype.FieldSensitive, v) + return u +} + +// UpdateSensitive sets the "sensitive" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateSensitive() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldSensitive) + return u +} + +// ClearSensitive clears the value of the "sensitive" field. +func (u *FieldTypeUpsert) ClearSensitive() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldSensitive) + return u +} + +// SetIP sets the "ip" field. +func (u *FieldTypeUpsert) SetIP(v net.IP) *FieldTypeUpsert { + u.Set(fieldtype.FieldIP, v) + return u +} + +// UpdateIP sets the "ip" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateIP() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldIP) + return u +} + +// ClearIP clears the value of the "ip" field. +func (u *FieldTypeUpsert) ClearIP() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldIP) + return u +} + +// SetNullInt64 sets the "null_int64" field. +func (u *FieldTypeUpsert) SetNullInt64(v *sql.NullInt64) *FieldTypeUpsert { + u.Set(fieldtype.FieldNullInt64, v) + return u +} + +// UpdateNullInt64 sets the "null_int64" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateNullInt64() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldNullInt64) + return u +} + +// ClearNullInt64 clears the value of the "null_int64" field. +func (u *FieldTypeUpsert) ClearNullInt64() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldNullInt64) + return u +} + +// SetSchemaInt sets the "schema_int" field. +func (u *FieldTypeUpsert) SetSchemaInt(v schema.Int) *FieldTypeUpsert { + u.Set(fieldtype.FieldSchemaInt, v) + return u +} + +// UpdateSchemaInt sets the "schema_int" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateSchemaInt() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldSchemaInt) + return u +} + +// AddSchemaInt adds v to the "schema_int" field. +func (u *FieldTypeUpsert) AddSchemaInt(v schema.Int) *FieldTypeUpsert { + u.Add(fieldtype.FieldSchemaInt, v) + return u +} + +// ClearSchemaInt clears the value of the "schema_int" field. +func (u *FieldTypeUpsert) ClearSchemaInt() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldSchemaInt) + return u +} + +// SetSchemaInt8 sets the "schema_int8" field. +func (u *FieldTypeUpsert) SetSchemaInt8(v schema.Int8) *FieldTypeUpsert { + u.Set(fieldtype.FieldSchemaInt8, v) + return u +} + +// UpdateSchemaInt8 sets the "schema_int8" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateSchemaInt8() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldSchemaInt8) + return u +} + +// AddSchemaInt8 adds v to the "schema_int8" field. +func (u *FieldTypeUpsert) AddSchemaInt8(v schema.Int8) *FieldTypeUpsert { + u.Add(fieldtype.FieldSchemaInt8, v) + return u +} + +// ClearSchemaInt8 clears the value of the "schema_int8" field. +func (u *FieldTypeUpsert) ClearSchemaInt8() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldSchemaInt8) + return u +} + +// SetSchemaInt64 sets the "schema_int64" field. +func (u *FieldTypeUpsert) SetSchemaInt64(v schema.Int64) *FieldTypeUpsert { + u.Set(fieldtype.FieldSchemaInt64, v) + return u +} + +// UpdateSchemaInt64 sets the "schema_int64" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateSchemaInt64() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldSchemaInt64) + return u +} + +// AddSchemaInt64 adds v to the "schema_int64" field. +func (u *FieldTypeUpsert) AddSchemaInt64(v schema.Int64) *FieldTypeUpsert { + u.Add(fieldtype.FieldSchemaInt64, v) + return u +} + +// ClearSchemaInt64 clears the value of the "schema_int64" field. +func (u *FieldTypeUpsert) ClearSchemaInt64() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldSchemaInt64) + return u +} + +// SetSchemaFloat sets the "schema_float" field. +func (u *FieldTypeUpsert) SetSchemaFloat(v schema.Float64) *FieldTypeUpsert { + u.Set(fieldtype.FieldSchemaFloat, v) + return u +} + +// UpdateSchemaFloat sets the "schema_float" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateSchemaFloat() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldSchemaFloat) + return u +} + +// AddSchemaFloat adds v to the "schema_float" field. +func (u *FieldTypeUpsert) AddSchemaFloat(v schema.Float64) *FieldTypeUpsert { + u.Add(fieldtype.FieldSchemaFloat, v) + return u +} + +// ClearSchemaFloat clears the value of the "schema_float" field. +func (u *FieldTypeUpsert) ClearSchemaFloat() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldSchemaFloat) + return u +} + +// SetSchemaFloat32 sets the "schema_float32" field. +func (u *FieldTypeUpsert) SetSchemaFloat32(v schema.Float32) *FieldTypeUpsert { + u.Set(fieldtype.FieldSchemaFloat32, v) + return u +} + +// UpdateSchemaFloat32 sets the "schema_float32" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateSchemaFloat32() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldSchemaFloat32) + return u +} + +// AddSchemaFloat32 adds v to the "schema_float32" field. +func (u *FieldTypeUpsert) AddSchemaFloat32(v schema.Float32) *FieldTypeUpsert { + u.Add(fieldtype.FieldSchemaFloat32, v) + return u +} + +// ClearSchemaFloat32 clears the value of the "schema_float32" field. +func (u *FieldTypeUpsert) ClearSchemaFloat32() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldSchemaFloat32) + return u +} + +// SetNullFloat sets the "null_float" field. +func (u *FieldTypeUpsert) SetNullFloat(v *sql.NullFloat64) *FieldTypeUpsert { + u.Set(fieldtype.FieldNullFloat, v) + return u +} + +// UpdateNullFloat sets the "null_float" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateNullFloat() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldNullFloat) + return u +} + +// ClearNullFloat clears the value of the "null_float" field. +func (u *FieldTypeUpsert) ClearNullFloat() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldNullFloat) + return u +} + +// SetRole sets the "role" field. +func (u *FieldTypeUpsert) SetRole(v role.Role) *FieldTypeUpsert { + u.Set(fieldtype.FieldRole, v) + return u +} + +// UpdateRole sets the "role" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateRole() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldRole) + return u +} + +// SetPriority sets the "priority" field. +func (u *FieldTypeUpsert) SetPriority(v role.Priority) *FieldTypeUpsert { + u.Set(fieldtype.FieldPriority, v) + return u +} + +// UpdatePriority sets the "priority" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdatePriority() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldPriority) + return u +} + +// ClearPriority clears the value of the "priority" field. +func (u *FieldTypeUpsert) ClearPriority() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldPriority) + return u +} + +// SetOptionalUUID sets the "optional_uuid" field. +func (u *FieldTypeUpsert) SetOptionalUUID(v uuid.UUID) *FieldTypeUpsert { + u.Set(fieldtype.FieldOptionalUUID, v) + return u +} + +// UpdateOptionalUUID sets the "optional_uuid" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateOptionalUUID() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldOptionalUUID) + return u +} + +// ClearOptionalUUID clears the value of the "optional_uuid" field. +func (u *FieldTypeUpsert) ClearOptionalUUID() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldOptionalUUID) + return u +} + +// SetNillableUUID sets the "nillable_uuid" field. +func (u *FieldTypeUpsert) SetNillableUUID(v uuid.UUID) *FieldTypeUpsert { + u.Set(fieldtype.FieldNillableUUID, v) + return u +} + +// UpdateNillableUUID sets the "nillable_uuid" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateNillableUUID() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldNillableUUID) + return u +} + +// ClearNillableUUID clears the value of the "nillable_uuid" field. +func (u *FieldTypeUpsert) ClearNillableUUID() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldNillableUUID) + return u +} + +// SetStrings sets the "strings" field. +func (u *FieldTypeUpsert) SetStrings(v []string) *FieldTypeUpsert { + u.Set(fieldtype.FieldStrings, v) + return u +} + +// UpdateStrings sets the "strings" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateStrings() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldStrings) + return u +} + +// ClearStrings clears the value of the "strings" field. +func (u *FieldTypeUpsert) ClearStrings() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldStrings) + return u +} + +// SetPair sets the "pair" field. +func (u *FieldTypeUpsert) SetPair(v schema.Pair) *FieldTypeUpsert { + u.Set(fieldtype.FieldPair, v) + return u +} + +// UpdatePair sets the "pair" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdatePair() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldPair) + return u +} + +// SetNilPair sets the "nil_pair" field. +func (u *FieldTypeUpsert) SetNilPair(v *schema.Pair) *FieldTypeUpsert { + u.Set(fieldtype.FieldNilPair, v) + return u +} + +// UpdateNilPair sets the "nil_pair" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateNilPair() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldNilPair) + return u +} + +// ClearNilPair clears the value of the "nil_pair" field. +func (u *FieldTypeUpsert) ClearNilPair() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldNilPair) + return u +} + +// SetVstring sets the "vstring" field. +func (u *FieldTypeUpsert) SetVstring(v schema.VString) *FieldTypeUpsert { + u.Set(fieldtype.FieldVstring, v) + return u +} + +// UpdateVstring sets the "vstring" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateVstring() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldVstring) + return u +} + +// SetTriple sets the "triple" field. +func (u *FieldTypeUpsert) SetTriple(v schema.Triple) *FieldTypeUpsert { + u.Set(fieldtype.FieldTriple, v) + return u +} + +// UpdateTriple sets the "triple" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateTriple() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldTriple) + return u +} + +// SetBigInt sets the "big_int" field. +func (u *FieldTypeUpsert) SetBigInt(v schema.BigInt) *FieldTypeUpsert { + u.Set(fieldtype.FieldBigInt, v) + return u +} + +// UpdateBigInt sets the "big_int" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdateBigInt() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldBigInt) + return u +} + +// AddBigInt adds v to the "big_int" field. +func (u *FieldTypeUpsert) AddBigInt(v schema.BigInt) *FieldTypeUpsert { + u.Add(fieldtype.FieldBigInt, v) + return u +} + +// ClearBigInt clears the value of the "big_int" field. +func (u *FieldTypeUpsert) ClearBigInt() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldBigInt) + return u +} + +// SetPasswordOther sets the "password_other" field. +func (u *FieldTypeUpsert) SetPasswordOther(v schema.Password) *FieldTypeUpsert { + u.Set(fieldtype.FieldPasswordOther, v) + return u +} + +// UpdatePasswordOther sets the "password_other" field to the value that was provided on create. +func (u *FieldTypeUpsert) UpdatePasswordOther() *FieldTypeUpsert { + u.SetExcluded(fieldtype.FieldPasswordOther) + return u +} + +// ClearPasswordOther clears the value of the "password_other" field. +func (u *FieldTypeUpsert) ClearPasswordOther() *FieldTypeUpsert { + u.SetNull(fieldtype.FieldPasswordOther) + return u +} + +// UpdateNewValues updates the mutable fields using the new values that were set on create. +// Using this option is equivalent to using: +// +// client.FieldType.Create(). +// OnConflict( +// sql.ResolveWithNewValues(), +// ). +// Exec(ctx) +func (u *FieldTypeUpsertOne) UpdateNewValues() *FieldTypeUpsertOne { + u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues()) + return u +} + +// Ignore sets each column to itself in case of conflict. +// Using this option is equivalent to using: +// +// client.FieldType.Create(). +// OnConflict(sql.ResolveWithIgnore()). +// Exec(ctx) +func (u *FieldTypeUpsertOne) Ignore() *FieldTypeUpsertOne { + u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore()) + return u +} + +// DoNothing configures the conflict_action to `DO NOTHING`. +// Supported only by SQLite and PostgreSQL. +func (u *FieldTypeUpsertOne) DoNothing() *FieldTypeUpsertOne { + u.create.conflict = append(u.create.conflict, sql.DoNothing()) + return u +} + +// Update allows overriding fields `UPDATE` values. See the FieldTypeCreate.OnConflict +// documentation for more info. +func (u *FieldTypeUpsertOne) Update(set func(*FieldTypeUpsert)) *FieldTypeUpsertOne { + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) { + set(&FieldTypeUpsert{UpdateSet: update}) + })) + return u +} + +// SetInt sets the "int" field. +func (u *FieldTypeUpsertOne) SetInt(v int) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetInt(v) + }) +} + +// AddInt adds v to the "int" field. +func (u *FieldTypeUpsertOne) AddInt(v int) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddInt(v) + }) +} + +// UpdateInt sets the "int" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateInt() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateInt() + }) +} + +// SetInt8 sets the "int8" field. +func (u *FieldTypeUpsertOne) SetInt8(v int8) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetInt8(v) + }) +} + +// AddInt8 adds v to the "int8" field. +func (u *FieldTypeUpsertOne) AddInt8(v int8) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddInt8(v) + }) +} + +// UpdateInt8 sets the "int8" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateInt8() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateInt8() + }) +} + +// SetInt16 sets the "int16" field. +func (u *FieldTypeUpsertOne) SetInt16(v int16) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetInt16(v) + }) +} + +// AddInt16 adds v to the "int16" field. +func (u *FieldTypeUpsertOne) AddInt16(v int16) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddInt16(v) + }) +} + +// UpdateInt16 sets the "int16" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateInt16() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateInt16() + }) +} + +// SetInt32 sets the "int32" field. +func (u *FieldTypeUpsertOne) SetInt32(v int32) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetInt32(v) + }) +} + +// AddInt32 adds v to the "int32" field. +func (u *FieldTypeUpsertOne) AddInt32(v int32) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddInt32(v) + }) +} + +// UpdateInt32 sets the "int32" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateInt32() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateInt32() + }) +} + +// SetInt64 sets the "int64" field. +func (u *FieldTypeUpsertOne) SetInt64(v int64) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetInt64(v) + }) +} + +// AddInt64 adds v to the "int64" field. +func (u *FieldTypeUpsertOne) AddInt64(v int64) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddInt64(v) + }) +} + +// UpdateInt64 sets the "int64" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateInt64() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateInt64() + }) +} + +// SetOptionalInt sets the "optional_int" field. +func (u *FieldTypeUpsertOne) SetOptionalInt(v int) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetOptionalInt(v) + }) +} + +// AddOptionalInt adds v to the "optional_int" field. +func (u *FieldTypeUpsertOne) AddOptionalInt(v int) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddOptionalInt(v) + }) +} + +// UpdateOptionalInt sets the "optional_int" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateOptionalInt() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateOptionalInt() + }) +} + +// ClearOptionalInt clears the value of the "optional_int" field. +func (u *FieldTypeUpsertOne) ClearOptionalInt() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearOptionalInt() + }) +} + +// SetOptionalInt8 sets the "optional_int8" field. +func (u *FieldTypeUpsertOne) SetOptionalInt8(v int8) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetOptionalInt8(v) + }) +} + +// AddOptionalInt8 adds v to the "optional_int8" field. +func (u *FieldTypeUpsertOne) AddOptionalInt8(v int8) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddOptionalInt8(v) + }) +} + +// UpdateOptionalInt8 sets the "optional_int8" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateOptionalInt8() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateOptionalInt8() + }) +} + +// ClearOptionalInt8 clears the value of the "optional_int8" field. +func (u *FieldTypeUpsertOne) ClearOptionalInt8() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearOptionalInt8() + }) +} + +// SetOptionalInt16 sets the "optional_int16" field. +func (u *FieldTypeUpsertOne) SetOptionalInt16(v int16) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetOptionalInt16(v) + }) +} + +// AddOptionalInt16 adds v to the "optional_int16" field. +func (u *FieldTypeUpsertOne) AddOptionalInt16(v int16) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddOptionalInt16(v) + }) +} + +// UpdateOptionalInt16 sets the "optional_int16" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateOptionalInt16() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateOptionalInt16() + }) +} + +// ClearOptionalInt16 clears the value of the "optional_int16" field. +func (u *FieldTypeUpsertOne) ClearOptionalInt16() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearOptionalInt16() + }) +} + +// SetOptionalInt32 sets the "optional_int32" field. +func (u *FieldTypeUpsertOne) SetOptionalInt32(v int32) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetOptionalInt32(v) + }) +} + +// AddOptionalInt32 adds v to the "optional_int32" field. +func (u *FieldTypeUpsertOne) AddOptionalInt32(v int32) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddOptionalInt32(v) + }) +} + +// UpdateOptionalInt32 sets the "optional_int32" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateOptionalInt32() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateOptionalInt32() + }) +} + +// ClearOptionalInt32 clears the value of the "optional_int32" field. +func (u *FieldTypeUpsertOne) ClearOptionalInt32() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearOptionalInt32() + }) +} + +// SetOptionalInt64 sets the "optional_int64" field. +func (u *FieldTypeUpsertOne) SetOptionalInt64(v int64) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetOptionalInt64(v) + }) +} + +// AddOptionalInt64 adds v to the "optional_int64" field. +func (u *FieldTypeUpsertOne) AddOptionalInt64(v int64) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddOptionalInt64(v) + }) +} + +// UpdateOptionalInt64 sets the "optional_int64" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateOptionalInt64() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateOptionalInt64() + }) +} + +// ClearOptionalInt64 clears the value of the "optional_int64" field. +func (u *FieldTypeUpsertOne) ClearOptionalInt64() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearOptionalInt64() + }) +} + +// SetNillableInt sets the "nillable_int" field. +func (u *FieldTypeUpsertOne) SetNillableInt(v int) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetNillableInt(v) + }) +} + +// AddNillableInt adds v to the "nillable_int" field. +func (u *FieldTypeUpsertOne) AddNillableInt(v int) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddNillableInt(v) + }) +} + +// UpdateNillableInt sets the "nillable_int" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateNillableInt() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateNillableInt() + }) +} + +// ClearNillableInt clears the value of the "nillable_int" field. +func (u *FieldTypeUpsertOne) ClearNillableInt() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearNillableInt() + }) +} + +// SetNillableInt8 sets the "nillable_int8" field. +func (u *FieldTypeUpsertOne) SetNillableInt8(v int8) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetNillableInt8(v) + }) +} + +// AddNillableInt8 adds v to the "nillable_int8" field. +func (u *FieldTypeUpsertOne) AddNillableInt8(v int8) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddNillableInt8(v) + }) +} + +// UpdateNillableInt8 sets the "nillable_int8" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateNillableInt8() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateNillableInt8() + }) +} + +// ClearNillableInt8 clears the value of the "nillable_int8" field. +func (u *FieldTypeUpsertOne) ClearNillableInt8() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearNillableInt8() + }) +} + +// SetNillableInt16 sets the "nillable_int16" field. +func (u *FieldTypeUpsertOne) SetNillableInt16(v int16) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetNillableInt16(v) + }) +} + +// AddNillableInt16 adds v to the "nillable_int16" field. +func (u *FieldTypeUpsertOne) AddNillableInt16(v int16) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddNillableInt16(v) + }) +} + +// UpdateNillableInt16 sets the "nillable_int16" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateNillableInt16() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateNillableInt16() + }) +} + +// ClearNillableInt16 clears the value of the "nillable_int16" field. +func (u *FieldTypeUpsertOne) ClearNillableInt16() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearNillableInt16() + }) +} + +// SetNillableInt32 sets the "nillable_int32" field. +func (u *FieldTypeUpsertOne) SetNillableInt32(v int32) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetNillableInt32(v) + }) +} + +// AddNillableInt32 adds v to the "nillable_int32" field. +func (u *FieldTypeUpsertOne) AddNillableInt32(v int32) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddNillableInt32(v) + }) +} + +// UpdateNillableInt32 sets the "nillable_int32" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateNillableInt32() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateNillableInt32() + }) +} + +// ClearNillableInt32 clears the value of the "nillable_int32" field. +func (u *FieldTypeUpsertOne) ClearNillableInt32() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearNillableInt32() + }) +} + +// SetNillableInt64 sets the "nillable_int64" field. +func (u *FieldTypeUpsertOne) SetNillableInt64(v int64) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetNillableInt64(v) + }) +} + +// AddNillableInt64 adds v to the "nillable_int64" field. +func (u *FieldTypeUpsertOne) AddNillableInt64(v int64) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddNillableInt64(v) + }) +} + +// UpdateNillableInt64 sets the "nillable_int64" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateNillableInt64() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateNillableInt64() + }) +} + +// ClearNillableInt64 clears the value of the "nillable_int64" field. +func (u *FieldTypeUpsertOne) ClearNillableInt64() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearNillableInt64() + }) +} + +// SetValidateOptionalInt32 sets the "validate_optional_int32" field. +func (u *FieldTypeUpsertOne) SetValidateOptionalInt32(v int32) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetValidateOptionalInt32(v) + }) +} + +// AddValidateOptionalInt32 adds v to the "validate_optional_int32" field. +func (u *FieldTypeUpsertOne) AddValidateOptionalInt32(v int32) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddValidateOptionalInt32(v) + }) +} + +// UpdateValidateOptionalInt32 sets the "validate_optional_int32" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateValidateOptionalInt32() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateValidateOptionalInt32() + }) +} + +// ClearValidateOptionalInt32 clears the value of the "validate_optional_int32" field. +func (u *FieldTypeUpsertOne) ClearValidateOptionalInt32() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearValidateOptionalInt32() + }) +} + +// SetOptionalUint sets the "optional_uint" field. +func (u *FieldTypeUpsertOne) SetOptionalUint(v uint) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetOptionalUint(v) + }) +} + +// AddOptionalUint adds v to the "optional_uint" field. +func (u *FieldTypeUpsertOne) AddOptionalUint(v uint) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddOptionalUint(v) + }) +} + +// UpdateOptionalUint sets the "optional_uint" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateOptionalUint() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateOptionalUint() + }) +} + +// ClearOptionalUint clears the value of the "optional_uint" field. +func (u *FieldTypeUpsertOne) ClearOptionalUint() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearOptionalUint() + }) +} + +// SetOptionalUint8 sets the "optional_uint8" field. +func (u *FieldTypeUpsertOne) SetOptionalUint8(v uint8) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetOptionalUint8(v) + }) +} + +// AddOptionalUint8 adds v to the "optional_uint8" field. +func (u *FieldTypeUpsertOne) AddOptionalUint8(v uint8) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddOptionalUint8(v) + }) +} + +// UpdateOptionalUint8 sets the "optional_uint8" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateOptionalUint8() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateOptionalUint8() + }) +} + +// ClearOptionalUint8 clears the value of the "optional_uint8" field. +func (u *FieldTypeUpsertOne) ClearOptionalUint8() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearOptionalUint8() + }) +} + +// SetOptionalUint16 sets the "optional_uint16" field. +func (u *FieldTypeUpsertOne) SetOptionalUint16(v uint16) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetOptionalUint16(v) + }) +} + +// AddOptionalUint16 adds v to the "optional_uint16" field. +func (u *FieldTypeUpsertOne) AddOptionalUint16(v uint16) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddOptionalUint16(v) + }) +} + +// UpdateOptionalUint16 sets the "optional_uint16" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateOptionalUint16() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateOptionalUint16() + }) +} + +// ClearOptionalUint16 clears the value of the "optional_uint16" field. +func (u *FieldTypeUpsertOne) ClearOptionalUint16() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearOptionalUint16() + }) +} + +// SetOptionalUint32 sets the "optional_uint32" field. +func (u *FieldTypeUpsertOne) SetOptionalUint32(v uint32) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetOptionalUint32(v) + }) +} + +// AddOptionalUint32 adds v to the "optional_uint32" field. +func (u *FieldTypeUpsertOne) AddOptionalUint32(v uint32) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddOptionalUint32(v) + }) +} + +// UpdateOptionalUint32 sets the "optional_uint32" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateOptionalUint32() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateOptionalUint32() + }) +} + +// ClearOptionalUint32 clears the value of the "optional_uint32" field. +func (u *FieldTypeUpsertOne) ClearOptionalUint32() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearOptionalUint32() + }) +} + +// SetOptionalUint64 sets the "optional_uint64" field. +func (u *FieldTypeUpsertOne) SetOptionalUint64(v uint64) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetOptionalUint64(v) + }) +} + +// AddOptionalUint64 adds v to the "optional_uint64" field. +func (u *FieldTypeUpsertOne) AddOptionalUint64(v uint64) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddOptionalUint64(v) + }) +} + +// UpdateOptionalUint64 sets the "optional_uint64" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateOptionalUint64() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateOptionalUint64() + }) +} + +// ClearOptionalUint64 clears the value of the "optional_uint64" field. +func (u *FieldTypeUpsertOne) ClearOptionalUint64() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearOptionalUint64() + }) +} + +// SetState sets the "state" field. +func (u *FieldTypeUpsertOne) SetState(v fieldtype.State) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetState(v) + }) +} + +// UpdateState sets the "state" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateState() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateState() + }) +} + +// ClearState clears the value of the "state" field. +func (u *FieldTypeUpsertOne) ClearState() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearState() + }) +} + +// SetOptionalFloat sets the "optional_float" field. +func (u *FieldTypeUpsertOne) SetOptionalFloat(v float64) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetOptionalFloat(v) + }) +} + +// AddOptionalFloat adds v to the "optional_float" field. +func (u *FieldTypeUpsertOne) AddOptionalFloat(v float64) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddOptionalFloat(v) + }) +} + +// UpdateOptionalFloat sets the "optional_float" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateOptionalFloat() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateOptionalFloat() + }) +} + +// ClearOptionalFloat clears the value of the "optional_float" field. +func (u *FieldTypeUpsertOne) ClearOptionalFloat() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearOptionalFloat() + }) +} + +// SetOptionalFloat32 sets the "optional_float32" field. +func (u *FieldTypeUpsertOne) SetOptionalFloat32(v float32) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetOptionalFloat32(v) + }) +} + +// AddOptionalFloat32 adds v to the "optional_float32" field. +func (u *FieldTypeUpsertOne) AddOptionalFloat32(v float32) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddOptionalFloat32(v) + }) +} + +// UpdateOptionalFloat32 sets the "optional_float32" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateOptionalFloat32() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateOptionalFloat32() + }) +} + +// ClearOptionalFloat32 clears the value of the "optional_float32" field. +func (u *FieldTypeUpsertOne) ClearOptionalFloat32() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearOptionalFloat32() + }) +} + +// SetText sets the "text" field. +func (u *FieldTypeUpsertOne) SetText(v string) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetText(v) + }) +} + +// UpdateText sets the "text" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateText() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateText() + }) +} + +// ClearText clears the value of the "text" field. +func (u *FieldTypeUpsertOne) ClearText() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearText() + }) +} + +// SetDatetime sets the "datetime" field. +func (u *FieldTypeUpsertOne) SetDatetime(v time.Time) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetDatetime(v) + }) +} + +// UpdateDatetime sets the "datetime" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateDatetime() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateDatetime() + }) +} + +// ClearDatetime clears the value of the "datetime" field. +func (u *FieldTypeUpsertOne) ClearDatetime() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearDatetime() + }) +} + +// SetDecimal sets the "decimal" field. +func (u *FieldTypeUpsertOne) SetDecimal(v float64) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetDecimal(v) + }) +} + +// AddDecimal adds v to the "decimal" field. +func (u *FieldTypeUpsertOne) AddDecimal(v float64) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddDecimal(v) + }) +} + +// UpdateDecimal sets the "decimal" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateDecimal() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateDecimal() + }) +} + +// ClearDecimal clears the value of the "decimal" field. +func (u *FieldTypeUpsertOne) ClearDecimal() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearDecimal() + }) +} + +// SetLinkOther sets the "link_other" field. +func (u *FieldTypeUpsertOne) SetLinkOther(v *schema.Link) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetLinkOther(v) + }) +} + +// UpdateLinkOther sets the "link_other" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateLinkOther() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateLinkOther() + }) +} + +// ClearLinkOther clears the value of the "link_other" field. +func (u *FieldTypeUpsertOne) ClearLinkOther() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearLinkOther() + }) +} + +// SetLinkOtherFunc sets the "link_other_func" field. +func (u *FieldTypeUpsertOne) SetLinkOtherFunc(v *schema.Link) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetLinkOtherFunc(v) + }) +} + +// UpdateLinkOtherFunc sets the "link_other_func" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateLinkOtherFunc() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateLinkOtherFunc() + }) +} + +// ClearLinkOtherFunc clears the value of the "link_other_func" field. +func (u *FieldTypeUpsertOne) ClearLinkOtherFunc() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearLinkOtherFunc() + }) +} + +// SetMAC sets the "mac" field. +func (u *FieldTypeUpsertOne) SetMAC(v schema.MAC) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetMAC(v) + }) +} + +// UpdateMAC sets the "mac" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateMAC() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateMAC() + }) +} + +// ClearMAC clears the value of the "mac" field. +func (u *FieldTypeUpsertOne) ClearMAC() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearMAC() + }) +} + +// SetStringArray sets the "string_array" field. +func (u *FieldTypeUpsertOne) SetStringArray(v schema.Strings) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetStringArray(v) + }) +} + +// UpdateStringArray sets the "string_array" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateStringArray() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateStringArray() + }) +} + +// ClearStringArray clears the value of the "string_array" field. +func (u *FieldTypeUpsertOne) ClearStringArray() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearStringArray() + }) +} + +// SetPassword sets the "password" field. +func (u *FieldTypeUpsertOne) SetPassword(v string) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetPassword(v) + }) +} + +// UpdatePassword sets the "password" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdatePassword() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdatePassword() + }) +} + +// ClearPassword clears the value of the "password" field. +func (u *FieldTypeUpsertOne) ClearPassword() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearPassword() + }) +} + +// SetStringScanner sets the "string_scanner" field. +func (u *FieldTypeUpsertOne) SetStringScanner(v schema.StringScanner) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetStringScanner(v) + }) +} + +// UpdateStringScanner sets the "string_scanner" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateStringScanner() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateStringScanner() + }) +} + +// ClearStringScanner clears the value of the "string_scanner" field. +func (u *FieldTypeUpsertOne) ClearStringScanner() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearStringScanner() + }) +} + +// SetDuration sets the "duration" field. +func (u *FieldTypeUpsertOne) SetDuration(v time.Duration) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetDuration(v) + }) +} + +// AddDuration adds v to the "duration" field. +func (u *FieldTypeUpsertOne) AddDuration(v time.Duration) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddDuration(v) + }) +} + +// UpdateDuration sets the "duration" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateDuration() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateDuration() + }) +} + +// ClearDuration clears the value of the "duration" field. +func (u *FieldTypeUpsertOne) ClearDuration() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearDuration() + }) +} + +// SetDir sets the "dir" field. +func (u *FieldTypeUpsertOne) SetDir(v http.Dir) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetDir(v) + }) +} + +// UpdateDir sets the "dir" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateDir() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateDir() + }) +} + +// SetNdir sets the "ndir" field. +func (u *FieldTypeUpsertOne) SetNdir(v http.Dir) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetNdir(v) + }) +} + +// UpdateNdir sets the "ndir" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateNdir() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateNdir() + }) +} + +// ClearNdir clears the value of the "ndir" field. +func (u *FieldTypeUpsertOne) ClearNdir() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearNdir() + }) +} + +// SetStr sets the "str" field. +func (u *FieldTypeUpsertOne) SetStr(v sql.NullString) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetStr(v) + }) +} + +// UpdateStr sets the "str" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateStr() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateStr() + }) +} + +// ClearStr clears the value of the "str" field. +func (u *FieldTypeUpsertOne) ClearStr() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearStr() + }) +} + +// SetNullStr sets the "null_str" field. +func (u *FieldTypeUpsertOne) SetNullStr(v *sql.NullString) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetNullStr(v) + }) +} + +// UpdateNullStr sets the "null_str" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateNullStr() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateNullStr() + }) +} + +// ClearNullStr clears the value of the "null_str" field. +func (u *FieldTypeUpsertOne) ClearNullStr() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearNullStr() + }) +} + +// SetLink sets the "link" field. +func (u *FieldTypeUpsertOne) SetLink(v schema.Link) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetLink(v) + }) +} + +// UpdateLink sets the "link" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateLink() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateLink() + }) +} + +// ClearLink clears the value of the "link" field. +func (u *FieldTypeUpsertOne) ClearLink() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearLink() + }) +} + +// SetNullLink sets the "null_link" field. +func (u *FieldTypeUpsertOne) SetNullLink(v *schema.Link) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetNullLink(v) + }) +} + +// UpdateNullLink sets the "null_link" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateNullLink() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateNullLink() + }) +} + +// ClearNullLink clears the value of the "null_link" field. +func (u *FieldTypeUpsertOne) ClearNullLink() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearNullLink() + }) +} + +// SetActive sets the "active" field. +func (u *FieldTypeUpsertOne) SetActive(v schema.Status) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetActive(v) + }) +} + +// UpdateActive sets the "active" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateActive() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateActive() + }) +} + +// ClearActive clears the value of the "active" field. +func (u *FieldTypeUpsertOne) ClearActive() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearActive() + }) +} + +// SetNullActive sets the "null_active" field. +func (u *FieldTypeUpsertOne) SetNullActive(v schema.Status) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetNullActive(v) + }) +} + +// UpdateNullActive sets the "null_active" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateNullActive() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateNullActive() + }) +} + +// ClearNullActive clears the value of the "null_active" field. +func (u *FieldTypeUpsertOne) ClearNullActive() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearNullActive() + }) +} + +// SetDeleted sets the "deleted" field. +func (u *FieldTypeUpsertOne) SetDeleted(v *sql.NullBool) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetDeleted(v) + }) +} + +// UpdateDeleted sets the "deleted" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateDeleted() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateDeleted() + }) +} + +// ClearDeleted clears the value of the "deleted" field. +func (u *FieldTypeUpsertOne) ClearDeleted() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearDeleted() + }) +} + +// SetDeletedAt sets the "deleted_at" field. +func (u *FieldTypeUpsertOne) SetDeletedAt(v *sql.NullTime) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetDeletedAt(v) + }) +} + +// UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateDeletedAt() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateDeletedAt() + }) +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (u *FieldTypeUpsertOne) ClearDeletedAt() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearDeletedAt() + }) +} + +// SetRawData sets the "raw_data" field. +func (u *FieldTypeUpsertOne) SetRawData(v []byte) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetRawData(v) + }) +} + +// UpdateRawData sets the "raw_data" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateRawData() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateRawData() + }) +} + +// ClearRawData clears the value of the "raw_data" field. +func (u *FieldTypeUpsertOne) ClearRawData() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearRawData() + }) +} + +// SetSensitive sets the "sensitive" field. +func (u *FieldTypeUpsertOne) SetSensitive(v []byte) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetSensitive(v) + }) +} + +// UpdateSensitive sets the "sensitive" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateSensitive() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateSensitive() + }) +} + +// ClearSensitive clears the value of the "sensitive" field. +func (u *FieldTypeUpsertOne) ClearSensitive() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearSensitive() + }) +} + +// SetIP sets the "ip" field. +func (u *FieldTypeUpsertOne) SetIP(v net.IP) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetIP(v) + }) +} + +// UpdateIP sets the "ip" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateIP() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateIP() + }) +} + +// ClearIP clears the value of the "ip" field. +func (u *FieldTypeUpsertOne) ClearIP() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearIP() + }) +} + +// SetNullInt64 sets the "null_int64" field. +func (u *FieldTypeUpsertOne) SetNullInt64(v *sql.NullInt64) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetNullInt64(v) + }) +} + +// UpdateNullInt64 sets the "null_int64" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateNullInt64() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateNullInt64() + }) +} + +// ClearNullInt64 clears the value of the "null_int64" field. +func (u *FieldTypeUpsertOne) ClearNullInt64() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearNullInt64() + }) +} + +// SetSchemaInt sets the "schema_int" field. +func (u *FieldTypeUpsertOne) SetSchemaInt(v schema.Int) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetSchemaInt(v) + }) +} + +// AddSchemaInt adds v to the "schema_int" field. +func (u *FieldTypeUpsertOne) AddSchemaInt(v schema.Int) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddSchemaInt(v) + }) +} + +// UpdateSchemaInt sets the "schema_int" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateSchemaInt() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateSchemaInt() + }) +} + +// ClearSchemaInt clears the value of the "schema_int" field. +func (u *FieldTypeUpsertOne) ClearSchemaInt() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearSchemaInt() + }) +} + +// SetSchemaInt8 sets the "schema_int8" field. +func (u *FieldTypeUpsertOne) SetSchemaInt8(v schema.Int8) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetSchemaInt8(v) + }) +} + +// AddSchemaInt8 adds v to the "schema_int8" field. +func (u *FieldTypeUpsertOne) AddSchemaInt8(v schema.Int8) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddSchemaInt8(v) + }) +} + +// UpdateSchemaInt8 sets the "schema_int8" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateSchemaInt8() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateSchemaInt8() + }) +} + +// ClearSchemaInt8 clears the value of the "schema_int8" field. +func (u *FieldTypeUpsertOne) ClearSchemaInt8() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearSchemaInt8() + }) +} + +// SetSchemaInt64 sets the "schema_int64" field. +func (u *FieldTypeUpsertOne) SetSchemaInt64(v schema.Int64) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetSchemaInt64(v) + }) +} + +// AddSchemaInt64 adds v to the "schema_int64" field. +func (u *FieldTypeUpsertOne) AddSchemaInt64(v schema.Int64) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddSchemaInt64(v) + }) +} + +// UpdateSchemaInt64 sets the "schema_int64" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateSchemaInt64() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateSchemaInt64() + }) +} + +// ClearSchemaInt64 clears the value of the "schema_int64" field. +func (u *FieldTypeUpsertOne) ClearSchemaInt64() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearSchemaInt64() + }) +} + +// SetSchemaFloat sets the "schema_float" field. +func (u *FieldTypeUpsertOne) SetSchemaFloat(v schema.Float64) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetSchemaFloat(v) + }) +} + +// AddSchemaFloat adds v to the "schema_float" field. +func (u *FieldTypeUpsertOne) AddSchemaFloat(v schema.Float64) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddSchemaFloat(v) + }) +} + +// UpdateSchemaFloat sets the "schema_float" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateSchemaFloat() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateSchemaFloat() + }) +} + +// ClearSchemaFloat clears the value of the "schema_float" field. +func (u *FieldTypeUpsertOne) ClearSchemaFloat() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearSchemaFloat() + }) +} + +// SetSchemaFloat32 sets the "schema_float32" field. +func (u *FieldTypeUpsertOne) SetSchemaFloat32(v schema.Float32) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetSchemaFloat32(v) + }) +} + +// AddSchemaFloat32 adds v to the "schema_float32" field. +func (u *FieldTypeUpsertOne) AddSchemaFloat32(v schema.Float32) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddSchemaFloat32(v) + }) +} + +// UpdateSchemaFloat32 sets the "schema_float32" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateSchemaFloat32() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateSchemaFloat32() + }) +} + +// ClearSchemaFloat32 clears the value of the "schema_float32" field. +func (u *FieldTypeUpsertOne) ClearSchemaFloat32() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearSchemaFloat32() + }) +} + +// SetNullFloat sets the "null_float" field. +func (u *FieldTypeUpsertOne) SetNullFloat(v *sql.NullFloat64) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetNullFloat(v) + }) +} + +// UpdateNullFloat sets the "null_float" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateNullFloat() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateNullFloat() + }) +} + +// ClearNullFloat clears the value of the "null_float" field. +func (u *FieldTypeUpsertOne) ClearNullFloat() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearNullFloat() + }) +} + +// SetRole sets the "role" field. +func (u *FieldTypeUpsertOne) SetRole(v role.Role) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetRole(v) + }) +} + +// UpdateRole sets the "role" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateRole() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateRole() + }) +} + +// SetPriority sets the "priority" field. +func (u *FieldTypeUpsertOne) SetPriority(v role.Priority) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetPriority(v) + }) +} + +// UpdatePriority sets the "priority" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdatePriority() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdatePriority() + }) +} + +// ClearPriority clears the value of the "priority" field. +func (u *FieldTypeUpsertOne) ClearPriority() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearPriority() + }) +} + +// SetOptionalUUID sets the "optional_uuid" field. +func (u *FieldTypeUpsertOne) SetOptionalUUID(v uuid.UUID) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetOptionalUUID(v) + }) +} + +// UpdateOptionalUUID sets the "optional_uuid" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateOptionalUUID() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateOptionalUUID() + }) +} + +// ClearOptionalUUID clears the value of the "optional_uuid" field. +func (u *FieldTypeUpsertOne) ClearOptionalUUID() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearOptionalUUID() + }) +} + +// SetNillableUUID sets the "nillable_uuid" field. +func (u *FieldTypeUpsertOne) SetNillableUUID(v uuid.UUID) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetNillableUUID(v) + }) +} + +// UpdateNillableUUID sets the "nillable_uuid" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateNillableUUID() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateNillableUUID() + }) +} + +// ClearNillableUUID clears the value of the "nillable_uuid" field. +func (u *FieldTypeUpsertOne) ClearNillableUUID() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearNillableUUID() + }) +} + +// SetStrings sets the "strings" field. +func (u *FieldTypeUpsertOne) SetStrings(v []string) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetStrings(v) + }) +} + +// UpdateStrings sets the "strings" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateStrings() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateStrings() + }) +} + +// ClearStrings clears the value of the "strings" field. +func (u *FieldTypeUpsertOne) ClearStrings() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearStrings() + }) +} + +// SetPair sets the "pair" field. +func (u *FieldTypeUpsertOne) SetPair(v schema.Pair) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetPair(v) + }) +} + +// UpdatePair sets the "pair" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdatePair() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdatePair() + }) +} + +// SetNilPair sets the "nil_pair" field. +func (u *FieldTypeUpsertOne) SetNilPair(v *schema.Pair) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetNilPair(v) + }) +} + +// UpdateNilPair sets the "nil_pair" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateNilPair() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateNilPair() + }) +} + +// ClearNilPair clears the value of the "nil_pair" field. +func (u *FieldTypeUpsertOne) ClearNilPair() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearNilPair() + }) +} + +// SetVstring sets the "vstring" field. +func (u *FieldTypeUpsertOne) SetVstring(v schema.VString) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetVstring(v) + }) +} + +// UpdateVstring sets the "vstring" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateVstring() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateVstring() + }) +} + +// SetTriple sets the "triple" field. +func (u *FieldTypeUpsertOne) SetTriple(v schema.Triple) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetTriple(v) + }) +} + +// UpdateTriple sets the "triple" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateTriple() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateTriple() + }) +} + +// SetBigInt sets the "big_int" field. +func (u *FieldTypeUpsertOne) SetBigInt(v schema.BigInt) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetBigInt(v) + }) +} + +// AddBigInt adds v to the "big_int" field. +func (u *FieldTypeUpsertOne) AddBigInt(v schema.BigInt) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.AddBigInt(v) + }) +} + +// UpdateBigInt sets the "big_int" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdateBigInt() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateBigInt() + }) +} + +// ClearBigInt clears the value of the "big_int" field. +func (u *FieldTypeUpsertOne) ClearBigInt() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearBigInt() + }) +} + +// SetPasswordOther sets the "password_other" field. +func (u *FieldTypeUpsertOne) SetPasswordOther(v schema.Password) *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.SetPasswordOther(v) + }) +} + +// UpdatePasswordOther sets the "password_other" field to the value that was provided on create. +func (u *FieldTypeUpsertOne) UpdatePasswordOther() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdatePasswordOther() + }) +} + +// ClearPasswordOther clears the value of the "password_other" field. +func (u *FieldTypeUpsertOne) ClearPasswordOther() *FieldTypeUpsertOne { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearPasswordOther() + }) +} + +// Exec executes the query. +func (u *FieldTypeUpsertOne) Exec(ctx context.Context) error { + if len(u.create.conflict) == 0 { + return errors.New("ent: missing options for FieldTypeCreate.OnConflict") + } + return u.create.Exec(ctx) +} + +// ExecX is like Exec, but panics if an error occurs. +func (u *FieldTypeUpsertOne) ExecX(ctx context.Context) { + if err := u.create.Exec(ctx); err != nil { + panic(err) + } +} + +// Exec executes the UPSERT query and returns the inserted/updated ID. +func (u *FieldTypeUpsertOne) ID(ctx context.Context) (id int, err error) { + node, err := u.create.Save(ctx) + if err != nil { + return id, err + } + return node.ID, nil +} + +// IDX is like ID, but panics if an error occurs. +func (u *FieldTypeUpsertOne) IDX(ctx context.Context) int { + id, err := u.ID(ctx) + if err != nil { + panic(err) + } + return id +} + +// FieldTypeCreateBulk is the builder for creating many FieldType entities in bulk. +type FieldTypeCreateBulk struct { + config + err error + builders []*FieldTypeCreate + conflict []sql.ConflictOption +} + +// Save creates the FieldType entities in the database. +func (_c *FieldTypeCreateBulk) Save(ctx context.Context) ([]*FieldType, error) { + if _c.err != nil { + return nil, _c.err + } + specs := make([]*sqlgraph.CreateSpec, len(_c.builders)) + nodes := make([]*FieldType, len(_c.builders)) + mutators := make([]Mutator, len(_c.builders)) + for i := range _c.builders { + func(i int, root context.Context) { + builder := _c.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*FieldTypeMutation) + if !ok { + return nil, fmt.Errorf("unexpected mutation type %T", m) + } + if err := builder.check(); err != nil { + return nil, err + } + builder.mutation = mutation + var err error + nodes[i], specs[i] = builder.createSpec() + if i < len(mutators)-1 { + _, err = mutators[i+1].Mutate(root, _c.builders[i+1].mutation) + } else { + spec := &sqlgraph.BatchCreateSpec{Nodes: specs} + spec.OnConflict = _c.conflict + // Invoke the actual operation on the latest mutation in the chain. + if err = sqlgraph.BatchCreate(ctx, _c.driver, spec); err != nil { + if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + } + } + if err != nil { + return nil, err + } + mutation.id = &nodes[i].ID + if specs[i].ID.Value != nil { + id := specs[i].ID.Value.(int64) + nodes[i].ID = int(id) + } + mutation.done = true + return nodes[i], nil + }) + for i := len(builder.hooks) - 1; i >= 0; i-- { + mut = builder.hooks[i](mut) + } + mutators[i] = mut + }(i, ctx) + } + if len(mutators) > 0 { + if _, err := mutators[0].Mutate(ctx, _c.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (_c *FieldTypeCreateBulk) SaveX(ctx context.Context) []*FieldType { + v, err := _c.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (_c *FieldTypeCreateBulk) Exec(ctx context.Context) error { + _, err := _c.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (_c *FieldTypeCreateBulk) ExecX(ctx context.Context) { + if err := _c.Exec(ctx); err != nil { + panic(err) + } +} + +// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause +// of the `INSERT` statement. For example: +// +// client.FieldType.CreateBulk(builders...). +// OnConflict( +// // Update the row with the new values +// // the was proposed for insertion. +// sql.ResolveWithNewValues(), +// ). +// // Override some of the fields with custom +// // update values. +// Update(func(u *ent.FieldTypeUpsert) { +// SetInt(v+v). +// }). +// Exec(ctx) +func (_c *FieldTypeCreateBulk) OnConflict(opts ...sql.ConflictOption) *FieldTypeUpsertBulk { + _c.conflict = opts + return &FieldTypeUpsertBulk{ + create: _c, + } +} + +// OnConflictColumns calls `OnConflict` and configures the columns +// as conflict target. Using this option is equivalent to using: +// +// client.FieldType.Create(). +// OnConflict(sql.ConflictColumns(columns...)). +// Exec(ctx) +func (_c *FieldTypeCreateBulk) OnConflictColumns(columns ...string) *FieldTypeUpsertBulk { + _c.conflict = append(_c.conflict, sql.ConflictColumns(columns...)) + return &FieldTypeUpsertBulk{ + create: _c, + } +} + +// FieldTypeUpsertBulk is the builder for "upsert"-ing +// a bulk of FieldType nodes. +type FieldTypeUpsertBulk struct { + create *FieldTypeCreateBulk +} + +// UpdateNewValues updates the mutable fields using the new values that +// were set on create. Using this option is equivalent to using: +// +// client.FieldType.Create(). +// OnConflict( +// sql.ResolveWithNewValues(), +// ). +// Exec(ctx) +func (u *FieldTypeUpsertBulk) UpdateNewValues() *FieldTypeUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues()) + return u +} + +// Ignore sets each column to itself in case of conflict. +// Using this option is equivalent to using: +// +// client.FieldType.Create(). +// OnConflict(sql.ResolveWithIgnore()). +// Exec(ctx) +func (u *FieldTypeUpsertBulk) Ignore() *FieldTypeUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore()) + return u +} + +// DoNothing configures the conflict_action to `DO NOTHING`. +// Supported only by SQLite and PostgreSQL. +func (u *FieldTypeUpsertBulk) DoNothing() *FieldTypeUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.DoNothing()) + return u +} + +// Update allows overriding fields `UPDATE` values. See the FieldTypeCreateBulk.OnConflict +// documentation for more info. +func (u *FieldTypeUpsertBulk) Update(set func(*FieldTypeUpsert)) *FieldTypeUpsertBulk { + u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) { + set(&FieldTypeUpsert{UpdateSet: update}) + })) + return u +} + +// SetInt sets the "int" field. +func (u *FieldTypeUpsertBulk) SetInt(v int) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetInt(v) + }) +} + +// AddInt adds v to the "int" field. +func (u *FieldTypeUpsertBulk) AddInt(v int) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddInt(v) + }) +} + +// UpdateInt sets the "int" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateInt() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateInt() + }) +} + +// SetInt8 sets the "int8" field. +func (u *FieldTypeUpsertBulk) SetInt8(v int8) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetInt8(v) + }) +} + +// AddInt8 adds v to the "int8" field. +func (u *FieldTypeUpsertBulk) AddInt8(v int8) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddInt8(v) + }) +} + +// UpdateInt8 sets the "int8" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateInt8() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateInt8() + }) +} + +// SetInt16 sets the "int16" field. +func (u *FieldTypeUpsertBulk) SetInt16(v int16) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetInt16(v) + }) +} + +// AddInt16 adds v to the "int16" field. +func (u *FieldTypeUpsertBulk) AddInt16(v int16) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddInt16(v) + }) +} + +// UpdateInt16 sets the "int16" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateInt16() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateInt16() + }) +} + +// SetInt32 sets the "int32" field. +func (u *FieldTypeUpsertBulk) SetInt32(v int32) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetInt32(v) + }) +} + +// AddInt32 adds v to the "int32" field. +func (u *FieldTypeUpsertBulk) AddInt32(v int32) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddInt32(v) + }) +} + +// UpdateInt32 sets the "int32" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateInt32() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateInt32() + }) +} + +// SetInt64 sets the "int64" field. +func (u *FieldTypeUpsertBulk) SetInt64(v int64) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetInt64(v) + }) +} + +// AddInt64 adds v to the "int64" field. +func (u *FieldTypeUpsertBulk) AddInt64(v int64) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddInt64(v) + }) +} + +// UpdateInt64 sets the "int64" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateInt64() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateInt64() + }) +} + +// SetOptionalInt sets the "optional_int" field. +func (u *FieldTypeUpsertBulk) SetOptionalInt(v int) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetOptionalInt(v) + }) +} + +// AddOptionalInt adds v to the "optional_int" field. +func (u *FieldTypeUpsertBulk) AddOptionalInt(v int) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddOptionalInt(v) + }) +} + +// UpdateOptionalInt sets the "optional_int" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateOptionalInt() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateOptionalInt() + }) +} + +// ClearOptionalInt clears the value of the "optional_int" field. +func (u *FieldTypeUpsertBulk) ClearOptionalInt() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearOptionalInt() + }) +} + +// SetOptionalInt8 sets the "optional_int8" field. +func (u *FieldTypeUpsertBulk) SetOptionalInt8(v int8) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetOptionalInt8(v) + }) +} + +// AddOptionalInt8 adds v to the "optional_int8" field. +func (u *FieldTypeUpsertBulk) AddOptionalInt8(v int8) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddOptionalInt8(v) + }) +} + +// UpdateOptionalInt8 sets the "optional_int8" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateOptionalInt8() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateOptionalInt8() + }) +} + +// ClearOptionalInt8 clears the value of the "optional_int8" field. +func (u *FieldTypeUpsertBulk) ClearOptionalInt8() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearOptionalInt8() + }) +} + +// SetOptionalInt16 sets the "optional_int16" field. +func (u *FieldTypeUpsertBulk) SetOptionalInt16(v int16) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetOptionalInt16(v) + }) +} + +// AddOptionalInt16 adds v to the "optional_int16" field. +func (u *FieldTypeUpsertBulk) AddOptionalInt16(v int16) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddOptionalInt16(v) + }) +} + +// UpdateOptionalInt16 sets the "optional_int16" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateOptionalInt16() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateOptionalInt16() + }) +} + +// ClearOptionalInt16 clears the value of the "optional_int16" field. +func (u *FieldTypeUpsertBulk) ClearOptionalInt16() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearOptionalInt16() + }) +} + +// SetOptionalInt32 sets the "optional_int32" field. +func (u *FieldTypeUpsertBulk) SetOptionalInt32(v int32) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetOptionalInt32(v) + }) +} + +// AddOptionalInt32 adds v to the "optional_int32" field. +func (u *FieldTypeUpsertBulk) AddOptionalInt32(v int32) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddOptionalInt32(v) + }) +} + +// UpdateOptionalInt32 sets the "optional_int32" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateOptionalInt32() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateOptionalInt32() + }) +} + +// ClearOptionalInt32 clears the value of the "optional_int32" field. +func (u *FieldTypeUpsertBulk) ClearOptionalInt32() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearOptionalInt32() + }) +} + +// SetOptionalInt64 sets the "optional_int64" field. +func (u *FieldTypeUpsertBulk) SetOptionalInt64(v int64) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetOptionalInt64(v) + }) +} + +// AddOptionalInt64 adds v to the "optional_int64" field. +func (u *FieldTypeUpsertBulk) AddOptionalInt64(v int64) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddOptionalInt64(v) + }) +} + +// UpdateOptionalInt64 sets the "optional_int64" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateOptionalInt64() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateOptionalInt64() + }) +} + +// ClearOptionalInt64 clears the value of the "optional_int64" field. +func (u *FieldTypeUpsertBulk) ClearOptionalInt64() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearOptionalInt64() + }) +} + +// SetNillableInt sets the "nillable_int" field. +func (u *FieldTypeUpsertBulk) SetNillableInt(v int) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetNillableInt(v) + }) +} + +// AddNillableInt adds v to the "nillable_int" field. +func (u *FieldTypeUpsertBulk) AddNillableInt(v int) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddNillableInt(v) + }) +} + +// UpdateNillableInt sets the "nillable_int" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateNillableInt() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateNillableInt() + }) +} + +// ClearNillableInt clears the value of the "nillable_int" field. +func (u *FieldTypeUpsertBulk) ClearNillableInt() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearNillableInt() + }) +} + +// SetNillableInt8 sets the "nillable_int8" field. +func (u *FieldTypeUpsertBulk) SetNillableInt8(v int8) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetNillableInt8(v) + }) +} + +// AddNillableInt8 adds v to the "nillable_int8" field. +func (u *FieldTypeUpsertBulk) AddNillableInt8(v int8) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddNillableInt8(v) + }) +} + +// UpdateNillableInt8 sets the "nillable_int8" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateNillableInt8() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateNillableInt8() + }) +} + +// ClearNillableInt8 clears the value of the "nillable_int8" field. +func (u *FieldTypeUpsertBulk) ClearNillableInt8() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearNillableInt8() + }) +} + +// SetNillableInt16 sets the "nillable_int16" field. +func (u *FieldTypeUpsertBulk) SetNillableInt16(v int16) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetNillableInt16(v) + }) +} + +// AddNillableInt16 adds v to the "nillable_int16" field. +func (u *FieldTypeUpsertBulk) AddNillableInt16(v int16) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddNillableInt16(v) + }) +} + +// UpdateNillableInt16 sets the "nillable_int16" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateNillableInt16() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateNillableInt16() + }) +} + +// ClearNillableInt16 clears the value of the "nillable_int16" field. +func (u *FieldTypeUpsertBulk) ClearNillableInt16() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearNillableInt16() + }) +} + +// SetNillableInt32 sets the "nillable_int32" field. +func (u *FieldTypeUpsertBulk) SetNillableInt32(v int32) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetNillableInt32(v) + }) +} + +// AddNillableInt32 adds v to the "nillable_int32" field. +func (u *FieldTypeUpsertBulk) AddNillableInt32(v int32) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddNillableInt32(v) + }) +} + +// UpdateNillableInt32 sets the "nillable_int32" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateNillableInt32() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateNillableInt32() + }) +} + +// ClearNillableInt32 clears the value of the "nillable_int32" field. +func (u *FieldTypeUpsertBulk) ClearNillableInt32() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearNillableInt32() + }) +} + +// SetNillableInt64 sets the "nillable_int64" field. +func (u *FieldTypeUpsertBulk) SetNillableInt64(v int64) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetNillableInt64(v) + }) +} + +// AddNillableInt64 adds v to the "nillable_int64" field. +func (u *FieldTypeUpsertBulk) AddNillableInt64(v int64) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddNillableInt64(v) + }) +} + +// UpdateNillableInt64 sets the "nillable_int64" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateNillableInt64() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateNillableInt64() + }) +} + +// ClearNillableInt64 clears the value of the "nillable_int64" field. +func (u *FieldTypeUpsertBulk) ClearNillableInt64() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearNillableInt64() + }) +} + +// SetValidateOptionalInt32 sets the "validate_optional_int32" field. +func (u *FieldTypeUpsertBulk) SetValidateOptionalInt32(v int32) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetValidateOptionalInt32(v) + }) +} + +// AddValidateOptionalInt32 adds v to the "validate_optional_int32" field. +func (u *FieldTypeUpsertBulk) AddValidateOptionalInt32(v int32) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddValidateOptionalInt32(v) + }) +} + +// UpdateValidateOptionalInt32 sets the "validate_optional_int32" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateValidateOptionalInt32() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateValidateOptionalInt32() + }) +} + +// ClearValidateOptionalInt32 clears the value of the "validate_optional_int32" field. +func (u *FieldTypeUpsertBulk) ClearValidateOptionalInt32() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearValidateOptionalInt32() + }) +} + +// SetOptionalUint sets the "optional_uint" field. +func (u *FieldTypeUpsertBulk) SetOptionalUint(v uint) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetOptionalUint(v) + }) +} + +// AddOptionalUint adds v to the "optional_uint" field. +func (u *FieldTypeUpsertBulk) AddOptionalUint(v uint) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddOptionalUint(v) + }) +} + +// UpdateOptionalUint sets the "optional_uint" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateOptionalUint() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateOptionalUint() + }) +} + +// ClearOptionalUint clears the value of the "optional_uint" field. +func (u *FieldTypeUpsertBulk) ClearOptionalUint() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearOptionalUint() + }) +} + +// SetOptionalUint8 sets the "optional_uint8" field. +func (u *FieldTypeUpsertBulk) SetOptionalUint8(v uint8) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetOptionalUint8(v) + }) +} + +// AddOptionalUint8 adds v to the "optional_uint8" field. +func (u *FieldTypeUpsertBulk) AddOptionalUint8(v uint8) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddOptionalUint8(v) + }) +} + +// UpdateOptionalUint8 sets the "optional_uint8" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateOptionalUint8() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateOptionalUint8() + }) +} + +// ClearOptionalUint8 clears the value of the "optional_uint8" field. +func (u *FieldTypeUpsertBulk) ClearOptionalUint8() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearOptionalUint8() + }) +} + +// SetOptionalUint16 sets the "optional_uint16" field. +func (u *FieldTypeUpsertBulk) SetOptionalUint16(v uint16) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetOptionalUint16(v) + }) +} + +// AddOptionalUint16 adds v to the "optional_uint16" field. +func (u *FieldTypeUpsertBulk) AddOptionalUint16(v uint16) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddOptionalUint16(v) + }) +} + +// UpdateOptionalUint16 sets the "optional_uint16" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateOptionalUint16() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateOptionalUint16() + }) +} + +// ClearOptionalUint16 clears the value of the "optional_uint16" field. +func (u *FieldTypeUpsertBulk) ClearOptionalUint16() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearOptionalUint16() + }) +} + +// SetOptionalUint32 sets the "optional_uint32" field. +func (u *FieldTypeUpsertBulk) SetOptionalUint32(v uint32) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetOptionalUint32(v) + }) +} + +// AddOptionalUint32 adds v to the "optional_uint32" field. +func (u *FieldTypeUpsertBulk) AddOptionalUint32(v uint32) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddOptionalUint32(v) + }) +} + +// UpdateOptionalUint32 sets the "optional_uint32" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateOptionalUint32() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateOptionalUint32() + }) +} + +// ClearOptionalUint32 clears the value of the "optional_uint32" field. +func (u *FieldTypeUpsertBulk) ClearOptionalUint32() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearOptionalUint32() + }) +} + +// SetOptionalUint64 sets the "optional_uint64" field. +func (u *FieldTypeUpsertBulk) SetOptionalUint64(v uint64) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetOptionalUint64(v) + }) +} + +// AddOptionalUint64 adds v to the "optional_uint64" field. +func (u *FieldTypeUpsertBulk) AddOptionalUint64(v uint64) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddOptionalUint64(v) + }) +} + +// UpdateOptionalUint64 sets the "optional_uint64" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateOptionalUint64() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateOptionalUint64() + }) +} + +// ClearOptionalUint64 clears the value of the "optional_uint64" field. +func (u *FieldTypeUpsertBulk) ClearOptionalUint64() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearOptionalUint64() + }) +} + +// SetState sets the "state" field. +func (u *FieldTypeUpsertBulk) SetState(v fieldtype.State) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetState(v) + }) +} + +// UpdateState sets the "state" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateState() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateState() + }) +} + +// ClearState clears the value of the "state" field. +func (u *FieldTypeUpsertBulk) ClearState() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearState() + }) +} + +// SetOptionalFloat sets the "optional_float" field. +func (u *FieldTypeUpsertBulk) SetOptionalFloat(v float64) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetOptionalFloat(v) + }) +} + +// AddOptionalFloat adds v to the "optional_float" field. +func (u *FieldTypeUpsertBulk) AddOptionalFloat(v float64) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddOptionalFloat(v) + }) +} + +// UpdateOptionalFloat sets the "optional_float" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateOptionalFloat() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateOptionalFloat() + }) +} + +// ClearOptionalFloat clears the value of the "optional_float" field. +func (u *FieldTypeUpsertBulk) ClearOptionalFloat() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearOptionalFloat() + }) +} + +// SetOptionalFloat32 sets the "optional_float32" field. +func (u *FieldTypeUpsertBulk) SetOptionalFloat32(v float32) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetOptionalFloat32(v) + }) +} + +// AddOptionalFloat32 adds v to the "optional_float32" field. +func (u *FieldTypeUpsertBulk) AddOptionalFloat32(v float32) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddOptionalFloat32(v) + }) +} + +// UpdateOptionalFloat32 sets the "optional_float32" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateOptionalFloat32() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateOptionalFloat32() + }) +} + +// ClearOptionalFloat32 clears the value of the "optional_float32" field. +func (u *FieldTypeUpsertBulk) ClearOptionalFloat32() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearOptionalFloat32() + }) +} + +// SetText sets the "text" field. +func (u *FieldTypeUpsertBulk) SetText(v string) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetText(v) + }) +} + +// UpdateText sets the "text" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateText() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateText() + }) +} + +// ClearText clears the value of the "text" field. +func (u *FieldTypeUpsertBulk) ClearText() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearText() + }) +} + +// SetDatetime sets the "datetime" field. +func (u *FieldTypeUpsertBulk) SetDatetime(v time.Time) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetDatetime(v) + }) +} + +// UpdateDatetime sets the "datetime" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateDatetime() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateDatetime() + }) +} + +// ClearDatetime clears the value of the "datetime" field. +func (u *FieldTypeUpsertBulk) ClearDatetime() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearDatetime() + }) +} + +// SetDecimal sets the "decimal" field. +func (u *FieldTypeUpsertBulk) SetDecimal(v float64) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetDecimal(v) + }) +} + +// AddDecimal adds v to the "decimal" field. +func (u *FieldTypeUpsertBulk) AddDecimal(v float64) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddDecimal(v) + }) +} + +// UpdateDecimal sets the "decimal" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateDecimal() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateDecimal() + }) +} + +// ClearDecimal clears the value of the "decimal" field. +func (u *FieldTypeUpsertBulk) ClearDecimal() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearDecimal() + }) +} + +// SetLinkOther sets the "link_other" field. +func (u *FieldTypeUpsertBulk) SetLinkOther(v *schema.Link) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetLinkOther(v) + }) +} + +// UpdateLinkOther sets the "link_other" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateLinkOther() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateLinkOther() + }) +} + +// ClearLinkOther clears the value of the "link_other" field. +func (u *FieldTypeUpsertBulk) ClearLinkOther() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearLinkOther() + }) +} + +// SetLinkOtherFunc sets the "link_other_func" field. +func (u *FieldTypeUpsertBulk) SetLinkOtherFunc(v *schema.Link) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetLinkOtherFunc(v) + }) +} + +// UpdateLinkOtherFunc sets the "link_other_func" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateLinkOtherFunc() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateLinkOtherFunc() + }) +} + +// ClearLinkOtherFunc clears the value of the "link_other_func" field. +func (u *FieldTypeUpsertBulk) ClearLinkOtherFunc() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearLinkOtherFunc() + }) +} + +// SetMAC sets the "mac" field. +func (u *FieldTypeUpsertBulk) SetMAC(v schema.MAC) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetMAC(v) + }) +} + +// UpdateMAC sets the "mac" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateMAC() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateMAC() + }) +} + +// ClearMAC clears the value of the "mac" field. +func (u *FieldTypeUpsertBulk) ClearMAC() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearMAC() + }) +} + +// SetStringArray sets the "string_array" field. +func (u *FieldTypeUpsertBulk) SetStringArray(v schema.Strings) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetStringArray(v) + }) +} + +// UpdateStringArray sets the "string_array" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateStringArray() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateStringArray() + }) +} + +// ClearStringArray clears the value of the "string_array" field. +func (u *FieldTypeUpsertBulk) ClearStringArray() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearStringArray() + }) +} + +// SetPassword sets the "password" field. +func (u *FieldTypeUpsertBulk) SetPassword(v string) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetPassword(v) + }) +} + +// UpdatePassword sets the "password" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdatePassword() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdatePassword() + }) +} + +// ClearPassword clears the value of the "password" field. +func (u *FieldTypeUpsertBulk) ClearPassword() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearPassword() + }) +} + +// SetStringScanner sets the "string_scanner" field. +func (u *FieldTypeUpsertBulk) SetStringScanner(v schema.StringScanner) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetStringScanner(v) + }) +} + +// UpdateStringScanner sets the "string_scanner" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateStringScanner() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateStringScanner() + }) +} + +// ClearStringScanner clears the value of the "string_scanner" field. +func (u *FieldTypeUpsertBulk) ClearStringScanner() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearStringScanner() + }) +} + +// SetDuration sets the "duration" field. +func (u *FieldTypeUpsertBulk) SetDuration(v time.Duration) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetDuration(v) + }) +} + +// AddDuration adds v to the "duration" field. +func (u *FieldTypeUpsertBulk) AddDuration(v time.Duration) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddDuration(v) + }) +} + +// UpdateDuration sets the "duration" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateDuration() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateDuration() + }) +} + +// ClearDuration clears the value of the "duration" field. +func (u *FieldTypeUpsertBulk) ClearDuration() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearDuration() + }) +} + +// SetDir sets the "dir" field. +func (u *FieldTypeUpsertBulk) SetDir(v http.Dir) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetDir(v) + }) +} + +// UpdateDir sets the "dir" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateDir() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateDir() + }) +} + +// SetNdir sets the "ndir" field. +func (u *FieldTypeUpsertBulk) SetNdir(v http.Dir) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetNdir(v) + }) +} + +// UpdateNdir sets the "ndir" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateNdir() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateNdir() + }) +} + +// ClearNdir clears the value of the "ndir" field. +func (u *FieldTypeUpsertBulk) ClearNdir() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearNdir() + }) +} + +// SetStr sets the "str" field. +func (u *FieldTypeUpsertBulk) SetStr(v sql.NullString) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetStr(v) + }) +} + +// UpdateStr sets the "str" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateStr() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateStr() + }) +} + +// ClearStr clears the value of the "str" field. +func (u *FieldTypeUpsertBulk) ClearStr() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearStr() + }) +} + +// SetNullStr sets the "null_str" field. +func (u *FieldTypeUpsertBulk) SetNullStr(v *sql.NullString) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetNullStr(v) + }) +} + +// UpdateNullStr sets the "null_str" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateNullStr() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateNullStr() + }) +} + +// ClearNullStr clears the value of the "null_str" field. +func (u *FieldTypeUpsertBulk) ClearNullStr() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearNullStr() + }) +} + +// SetLink sets the "link" field. +func (u *FieldTypeUpsertBulk) SetLink(v schema.Link) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetLink(v) + }) +} + +// UpdateLink sets the "link" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateLink() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateLink() + }) +} + +// ClearLink clears the value of the "link" field. +func (u *FieldTypeUpsertBulk) ClearLink() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearLink() + }) +} + +// SetNullLink sets the "null_link" field. +func (u *FieldTypeUpsertBulk) SetNullLink(v *schema.Link) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetNullLink(v) + }) +} + +// UpdateNullLink sets the "null_link" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateNullLink() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateNullLink() + }) +} + +// ClearNullLink clears the value of the "null_link" field. +func (u *FieldTypeUpsertBulk) ClearNullLink() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearNullLink() + }) +} + +// SetActive sets the "active" field. +func (u *FieldTypeUpsertBulk) SetActive(v schema.Status) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetActive(v) + }) +} + +// UpdateActive sets the "active" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateActive() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateActive() + }) +} + +// ClearActive clears the value of the "active" field. +func (u *FieldTypeUpsertBulk) ClearActive() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearActive() + }) +} + +// SetNullActive sets the "null_active" field. +func (u *FieldTypeUpsertBulk) SetNullActive(v schema.Status) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetNullActive(v) + }) +} + +// UpdateNullActive sets the "null_active" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateNullActive() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateNullActive() + }) +} + +// ClearNullActive clears the value of the "null_active" field. +func (u *FieldTypeUpsertBulk) ClearNullActive() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearNullActive() + }) +} + +// SetDeleted sets the "deleted" field. +func (u *FieldTypeUpsertBulk) SetDeleted(v *sql.NullBool) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetDeleted(v) + }) +} + +// UpdateDeleted sets the "deleted" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateDeleted() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateDeleted() + }) +} + +// ClearDeleted clears the value of the "deleted" field. +func (u *FieldTypeUpsertBulk) ClearDeleted() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearDeleted() + }) +} + +// SetDeletedAt sets the "deleted_at" field. +func (u *FieldTypeUpsertBulk) SetDeletedAt(v *sql.NullTime) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetDeletedAt(v) + }) +} + +// UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateDeletedAt() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateDeletedAt() + }) +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (u *FieldTypeUpsertBulk) ClearDeletedAt() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearDeletedAt() + }) +} + +// SetRawData sets the "raw_data" field. +func (u *FieldTypeUpsertBulk) SetRawData(v []byte) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetRawData(v) + }) +} + +// UpdateRawData sets the "raw_data" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateRawData() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateRawData() + }) +} + +// ClearRawData clears the value of the "raw_data" field. +func (u *FieldTypeUpsertBulk) ClearRawData() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearRawData() + }) +} + +// SetSensitive sets the "sensitive" field. +func (u *FieldTypeUpsertBulk) SetSensitive(v []byte) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetSensitive(v) + }) +} + +// UpdateSensitive sets the "sensitive" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateSensitive() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateSensitive() + }) +} + +// ClearSensitive clears the value of the "sensitive" field. +func (u *FieldTypeUpsertBulk) ClearSensitive() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearSensitive() + }) +} + +// SetIP sets the "ip" field. +func (u *FieldTypeUpsertBulk) SetIP(v net.IP) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetIP(v) + }) +} + +// UpdateIP sets the "ip" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateIP() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateIP() + }) +} + +// ClearIP clears the value of the "ip" field. +func (u *FieldTypeUpsertBulk) ClearIP() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearIP() + }) +} + +// SetNullInt64 sets the "null_int64" field. +func (u *FieldTypeUpsertBulk) SetNullInt64(v *sql.NullInt64) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetNullInt64(v) + }) +} + +// UpdateNullInt64 sets the "null_int64" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateNullInt64() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateNullInt64() + }) +} + +// ClearNullInt64 clears the value of the "null_int64" field. +func (u *FieldTypeUpsertBulk) ClearNullInt64() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearNullInt64() + }) +} + +// SetSchemaInt sets the "schema_int" field. +func (u *FieldTypeUpsertBulk) SetSchemaInt(v schema.Int) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetSchemaInt(v) + }) +} + +// AddSchemaInt adds v to the "schema_int" field. +func (u *FieldTypeUpsertBulk) AddSchemaInt(v schema.Int) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddSchemaInt(v) + }) +} + +// UpdateSchemaInt sets the "schema_int" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateSchemaInt() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateSchemaInt() + }) +} + +// ClearSchemaInt clears the value of the "schema_int" field. +func (u *FieldTypeUpsertBulk) ClearSchemaInt() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearSchemaInt() + }) +} + +// SetSchemaInt8 sets the "schema_int8" field. +func (u *FieldTypeUpsertBulk) SetSchemaInt8(v schema.Int8) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetSchemaInt8(v) + }) +} + +// AddSchemaInt8 adds v to the "schema_int8" field. +func (u *FieldTypeUpsertBulk) AddSchemaInt8(v schema.Int8) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddSchemaInt8(v) + }) +} + +// UpdateSchemaInt8 sets the "schema_int8" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateSchemaInt8() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateSchemaInt8() + }) +} + +// ClearSchemaInt8 clears the value of the "schema_int8" field. +func (u *FieldTypeUpsertBulk) ClearSchemaInt8() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearSchemaInt8() + }) +} + +// SetSchemaInt64 sets the "schema_int64" field. +func (u *FieldTypeUpsertBulk) SetSchemaInt64(v schema.Int64) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetSchemaInt64(v) + }) +} + +// AddSchemaInt64 adds v to the "schema_int64" field. +func (u *FieldTypeUpsertBulk) AddSchemaInt64(v schema.Int64) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddSchemaInt64(v) + }) +} + +// UpdateSchemaInt64 sets the "schema_int64" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateSchemaInt64() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateSchemaInt64() + }) +} + +// ClearSchemaInt64 clears the value of the "schema_int64" field. +func (u *FieldTypeUpsertBulk) ClearSchemaInt64() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearSchemaInt64() + }) +} + +// SetSchemaFloat sets the "schema_float" field. +func (u *FieldTypeUpsertBulk) SetSchemaFloat(v schema.Float64) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetSchemaFloat(v) + }) +} + +// AddSchemaFloat adds v to the "schema_float" field. +func (u *FieldTypeUpsertBulk) AddSchemaFloat(v schema.Float64) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddSchemaFloat(v) + }) +} + +// UpdateSchemaFloat sets the "schema_float" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateSchemaFloat() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateSchemaFloat() + }) +} + +// ClearSchemaFloat clears the value of the "schema_float" field. +func (u *FieldTypeUpsertBulk) ClearSchemaFloat() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearSchemaFloat() + }) +} + +// SetSchemaFloat32 sets the "schema_float32" field. +func (u *FieldTypeUpsertBulk) SetSchemaFloat32(v schema.Float32) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetSchemaFloat32(v) + }) +} + +// AddSchemaFloat32 adds v to the "schema_float32" field. +func (u *FieldTypeUpsertBulk) AddSchemaFloat32(v schema.Float32) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddSchemaFloat32(v) + }) +} + +// UpdateSchemaFloat32 sets the "schema_float32" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateSchemaFloat32() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateSchemaFloat32() + }) +} + +// ClearSchemaFloat32 clears the value of the "schema_float32" field. +func (u *FieldTypeUpsertBulk) ClearSchemaFloat32() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearSchemaFloat32() + }) +} + +// SetNullFloat sets the "null_float" field. +func (u *FieldTypeUpsertBulk) SetNullFloat(v *sql.NullFloat64) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetNullFloat(v) + }) +} + +// UpdateNullFloat sets the "null_float" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateNullFloat() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateNullFloat() + }) +} + +// ClearNullFloat clears the value of the "null_float" field. +func (u *FieldTypeUpsertBulk) ClearNullFloat() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearNullFloat() + }) +} + +// SetRole sets the "role" field. +func (u *FieldTypeUpsertBulk) SetRole(v role.Role) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetRole(v) + }) +} + +// UpdateRole sets the "role" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateRole() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateRole() + }) +} + +// SetPriority sets the "priority" field. +func (u *FieldTypeUpsertBulk) SetPriority(v role.Priority) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetPriority(v) + }) +} + +// UpdatePriority sets the "priority" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdatePriority() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdatePriority() + }) +} + +// ClearPriority clears the value of the "priority" field. +func (u *FieldTypeUpsertBulk) ClearPriority() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearPriority() + }) +} + +// SetOptionalUUID sets the "optional_uuid" field. +func (u *FieldTypeUpsertBulk) SetOptionalUUID(v uuid.UUID) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetOptionalUUID(v) + }) +} + +// UpdateOptionalUUID sets the "optional_uuid" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateOptionalUUID() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateOptionalUUID() + }) +} + +// ClearOptionalUUID clears the value of the "optional_uuid" field. +func (u *FieldTypeUpsertBulk) ClearOptionalUUID() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearOptionalUUID() + }) +} + +// SetNillableUUID sets the "nillable_uuid" field. +func (u *FieldTypeUpsertBulk) SetNillableUUID(v uuid.UUID) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetNillableUUID(v) + }) +} + +// UpdateNillableUUID sets the "nillable_uuid" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateNillableUUID() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateNillableUUID() + }) +} + +// ClearNillableUUID clears the value of the "nillable_uuid" field. +func (u *FieldTypeUpsertBulk) ClearNillableUUID() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearNillableUUID() + }) +} + +// SetStrings sets the "strings" field. +func (u *FieldTypeUpsertBulk) SetStrings(v []string) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetStrings(v) + }) +} + +// UpdateStrings sets the "strings" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateStrings() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateStrings() + }) +} + +// ClearStrings clears the value of the "strings" field. +func (u *FieldTypeUpsertBulk) ClearStrings() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearStrings() + }) +} + +// SetPair sets the "pair" field. +func (u *FieldTypeUpsertBulk) SetPair(v schema.Pair) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetPair(v) + }) +} + +// UpdatePair sets the "pair" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdatePair() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdatePair() + }) +} + +// SetNilPair sets the "nil_pair" field. +func (u *FieldTypeUpsertBulk) SetNilPair(v *schema.Pair) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetNilPair(v) + }) +} + +// UpdateNilPair sets the "nil_pair" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateNilPair() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateNilPair() + }) +} + +// ClearNilPair clears the value of the "nil_pair" field. +func (u *FieldTypeUpsertBulk) ClearNilPair() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearNilPair() + }) +} + +// SetVstring sets the "vstring" field. +func (u *FieldTypeUpsertBulk) SetVstring(v schema.VString) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetVstring(v) + }) +} + +// UpdateVstring sets the "vstring" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateVstring() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateVstring() + }) +} + +// SetTriple sets the "triple" field. +func (u *FieldTypeUpsertBulk) SetTriple(v schema.Triple) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetTriple(v) + }) +} + +// UpdateTriple sets the "triple" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateTriple() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateTriple() + }) +} + +// SetBigInt sets the "big_int" field. +func (u *FieldTypeUpsertBulk) SetBigInt(v schema.BigInt) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetBigInt(v) + }) +} + +// AddBigInt adds v to the "big_int" field. +func (u *FieldTypeUpsertBulk) AddBigInt(v schema.BigInt) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.AddBigInt(v) + }) +} + +// UpdateBigInt sets the "big_int" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdateBigInt() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdateBigInt() + }) +} + +// ClearBigInt clears the value of the "big_int" field. +func (u *FieldTypeUpsertBulk) ClearBigInt() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearBigInt() + }) +} + +// SetPasswordOther sets the "password_other" field. +func (u *FieldTypeUpsertBulk) SetPasswordOther(v schema.Password) *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.SetPasswordOther(v) + }) +} + +// UpdatePasswordOther sets the "password_other" field to the value that was provided on create. +func (u *FieldTypeUpsertBulk) UpdatePasswordOther() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.UpdatePasswordOther() + }) +} + +// ClearPasswordOther clears the value of the "password_other" field. +func (u *FieldTypeUpsertBulk) ClearPasswordOther() *FieldTypeUpsertBulk { + return u.Update(func(s *FieldTypeUpsert) { + s.ClearPasswordOther() + }) +} + +// Exec executes the query. +func (u *FieldTypeUpsertBulk) Exec(ctx context.Context) error { + if u.create.err != nil { + return u.create.err + } + for i, b := range u.create.builders { + if len(b.conflict) != 0 { + return fmt.Errorf("ent: OnConflict was set for builder %d. Set it on the FieldTypeCreateBulk instead", i) + } + } + if len(u.create.conflict) == 0 { + return errors.New("ent: missing options for FieldTypeCreateBulk.OnConflict") + } + return u.create.Exec(ctx) +} + +// ExecX is like Exec, but panics if an error occurs. +func (u *FieldTypeUpsertBulk) ExecX(ctx context.Context) { + if err := u.create.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/entc/integration/ent/mutation.go b/entc/integration/ent/mutation.go new file mode 100644 index 0000000..03af3b9 --- /dev/null +++ b/entc/integration/ent/mutation.go @@ -0,0 +1,4982 @@ +// 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 ent + +import ( + "context" + "errors" + "fmt" + "math/big" + "net" + "net/http" + "net/url" + "sync" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/entc/integration/ent/api" + "entgo.io/ent/entc/integration/ent/builder" + "entgo.io/ent/entc/integration/ent/card" + "entgo.io/ent/entc/integration/ent/comment" + "entgo.io/ent/entc/integration/ent/document" + "entgo.io/ent/entc/integration/ent/exvaluescan" + "entgo.io/ent/entc/integration/ent/fieldtype" + "entgo.io/ent/entc/integration/ent/file" + "entgo.io/ent/entc/integration/ent/filetype" + "entgo.io/ent/entc/integration/ent/goods" + "entgo.io/ent/entc/integration/ent/group" + "entgo.io/ent/entc/integration/ent/groupinfo" + "entgo.io/ent/entc/integration/ent/item" + "entgo.io/ent/entc/integration/ent/license" + "entgo.io/ent/entc/integration/ent/node" + "entgo.io/ent/entc/integration/ent/pc" + "entgo.io/ent/entc/integration/ent/pet" + "entgo.io/ent/entc/integration/ent/role" + "entgo.io/ent/entc/integration/ent/schema" + schemadir "entgo.io/ent/entc/integration/ent/schema/dir" + "entgo.io/ent/entc/integration/ent/schema/task" + "entgo.io/ent/entc/integration/ent/spec" + enttask "entgo.io/ent/entc/integration/ent/task" + "entgo.io/ent/entc/integration/ent/user" + "github.com/google/uuid" +) + +const ( + // Operation types. + OpCreate = ent.OpCreate + OpDelete = ent.OpDelete + OpDeleteOne = ent.OpDeleteOne + OpUpdate = ent.OpUpdate + OpUpdateOne = ent.OpUpdateOne + + // Node types. + TypeAPI = "Api" + TypeBuilder = "Builder" + TypeCard = "Card" + TypeComment = "Comment" + TypeDocument = "Document" + TypeExValueScan = "ExValueScan" + TypeFieldType = "FieldType" + TypeFile = "File" + TypeFileType = "FileType" + TypeGoods = "Goods" + TypeGroup = "Group" + TypeGroupInfo = "GroupInfo" + TypeItem = "Item" + TypeLicense = "License" + TypeNode = "Node" + TypePC = "PC" + TypePet = "Pet" + TypeSpec = "Spec" + TypeTask = "Task" + TypeUser = "User" +) + +// APIMutation represents an operation that mutates the Api nodes in the graph. +type APIMutation struct { + api.Mutation + config + id *int + done bool + oldValue func(context.Context) (*Api, error) +} + +var _ ent.Mutation = (*APIMutation)(nil) + +// apiOption allows management of the mutation configuration using functional options. +type apiOption func(*APIMutation) + +// newAPIMutation creates new mutation for the Api entity. +func newAPIMutation(c config, op Op, opts ...apiOption) *APIMutation { + m := &APIMutation{ + Mutation: *api.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *APIMutation) ID() (id int, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withApiID sets the ID field of the mutation. +func withApiID(id int) apiOption { + return func(m *APIMutation) { + var ( + err error + once sync.Once + value *Api + ) + m.oldValue = func(ctx context.Context) (*Api, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Api.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withApi sets the old Api of the mutation. +func withApi(node *Api) apiOption { + return func(m *APIMutation) { + m.oldValue = func(context.Context) (*Api, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m APIMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m APIMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *APIMutation) IDs(ctx context.Context) ([]int, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []int{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().Api.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// 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 *APIMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + return nil, fmt.Errorf("unknown Api field %s", name) +} + +// BuilderMutation represents an operation that mutates the Builder nodes in the graph. +type BuilderMutation struct { + builder.Mutation + config + id *int + done bool + oldValue func(context.Context) (*Builder, error) +} + +var _ ent.Mutation = (*BuilderMutation)(nil) + +// builderOption allows management of the mutation configuration using functional options. +type builderOption func(*BuilderMutation) + +// newBuilderMutation creates new mutation for the Builder entity. +func newBuilderMutation(c config, op Op, opts ...builderOption) *BuilderMutation { + m := &BuilderMutation{ + Mutation: *builder.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *BuilderMutation) ID() (id int, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withBuilderID sets the ID field of the mutation. +func withBuilderID(id int) builderOption { + return func(m *BuilderMutation) { + var ( + err error + once sync.Once + value *Builder + ) + m.oldValue = func(ctx context.Context) (*Builder, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Builder.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withBuilder sets the old Builder of the mutation. +func withBuilder(node *Builder) builderOption { + return func(m *BuilderMutation) { + m.oldValue = func(context.Context) (*Builder, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m BuilderMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m BuilderMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *BuilderMutation) IDs(ctx context.Context) ([]int, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []int{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().Builder.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// 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 *BuilderMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + return nil, fmt.Errorf("unknown Builder field %s", name) +} + +// CardMutation represents an operation that mutates the Card nodes in the graph. +type CardMutation struct { + card.Mutation + config + id *int + done bool + oldValue func(context.Context) (*Card, error) +} + +var _ ent.Mutation = (*CardMutation)(nil) + +// cardOption allows management of the mutation configuration using functional options. +type cardOption func(*CardMutation) + +// newCardMutation creates new mutation for the Card entity. +func newCardMutation(c config, op Op, opts ...cardOption) *CardMutation { + m := &CardMutation{ + Mutation: *card.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *CardMutation) ID() (id int, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withCardID sets the ID field of the mutation. +func withCardID(id int) cardOption { + return func(m *CardMutation) { + var ( + err error + once sync.Once + value *Card + ) + m.oldValue = func(ctx context.Context) (*Card, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Card.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withCard sets the old Card of the mutation. +func withCard(node *Card) cardOption { + return func(m *CardMutation) { + m.oldValue = func(context.Context) (*Card, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m CardMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m CardMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *CardMutation) IDs(ctx context.Context) ([]int, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []int{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().Card.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldCreateTime returns the old "create_time" field's value of the Card entity. +// If the Card object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *CardMutation) OldCreateTime(ctx context.Context) (v time.Time, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldCreateTime is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldCreateTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreateTime: %w", err) + } + return oldValue.CreateTime, nil +} + +// OldUpdateTime returns the old "update_time" field's value of the Card entity. +// If the Card object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *CardMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldUpdateTime is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldUpdateTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdateTime: %w", err) + } + return oldValue.UpdateTime, nil +} + +// OldBalance returns the old "balance" field's value of the Card entity. +// If the Card object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *CardMutation) OldBalance(ctx context.Context) (v float64, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldBalance is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldBalance requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldBalance: %w", err) + } + return oldValue.Balance, nil +} + +// OldNumber returns the old "number" field's value of the Card entity. +// If the Card object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *CardMutation) OldNumber(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNumber is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNumber requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNumber: %w", err) + } + return oldValue.Number, nil +} + +// OldName returns the old "name" field's value of the Card entity. +// If the Card object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *CardMutation) OldName(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// 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 *CardMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case card.FieldCreateTime: + return m.OldCreateTime(ctx) + case card.FieldUpdateTime: + return m.OldUpdateTime(ctx) + case card.FieldBalance: + return m.OldBalance(ctx) + case card.FieldNumber: + return m.OldNumber(ctx) + case card.FieldName: + return m.OldName(ctx) + } + return nil, fmt.Errorf("unknown Card field %s", name) +} + +// CommentMutation represents an operation that mutates the Comment nodes in the graph. +type CommentMutation struct { + comment.Mutation + config + id *int + done bool + oldValue func(context.Context) (*Comment, error) +} + +var _ ent.Mutation = (*CommentMutation)(nil) + +// commentOption allows management of the mutation configuration using functional options. +type commentOption func(*CommentMutation) + +// newCommentMutation creates new mutation for the Comment entity. +func newCommentMutation(c config, op Op, opts ...commentOption) *CommentMutation { + m := &CommentMutation{ + Mutation: *comment.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *CommentMutation) ID() (id int, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withCommentID sets the ID field of the mutation. +func withCommentID(id int) commentOption { + return func(m *CommentMutation) { + var ( + err error + once sync.Once + value *Comment + ) + m.oldValue = func(ctx context.Context) (*Comment, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Comment.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withComment sets the old Comment of the mutation. +func withComment(node *Comment) commentOption { + return func(m *CommentMutation) { + m.oldValue = func(context.Context) (*Comment, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m CommentMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m CommentMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *CommentMutation) IDs(ctx context.Context) ([]int, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []int{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().Comment.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldUniqueInt returns the old "unique_int" field's value of the Comment entity. +// If the Comment object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *CommentMutation) OldUniqueInt(ctx context.Context) (v int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldUniqueInt is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldUniqueInt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUniqueInt: %w", err) + } + return oldValue.UniqueInt, nil +} + +// OldUniqueFloat returns the old "unique_float" field's value of the Comment entity. +// If the Comment object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *CommentMutation) OldUniqueFloat(ctx context.Context) (v float64, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldUniqueFloat is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldUniqueFloat requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUniqueFloat: %w", err) + } + return oldValue.UniqueFloat, nil +} + +// OldNillableInt returns the old "nillable_int" field's value of the Comment entity. +// If the Comment object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *CommentMutation) OldNillableInt(ctx context.Context) (v *int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNillableInt is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNillableInt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNillableInt: %w", err) + } + return oldValue.NillableInt, nil +} + +// OldTable returns the old "table" field's value of the Comment entity. +// If the Comment object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *CommentMutation) OldTable(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldTable is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldTable requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTable: %w", err) + } + return oldValue.Table, nil +} + +// OldDir returns the old "dir" field's value of the Comment entity. +// If the Comment object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *CommentMutation) OldDir(ctx context.Context) (v schemadir.Dir, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldDir is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldDir requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDir: %w", err) + } + return oldValue.Dir, nil +} + +// OldClient returns the old "client" field's value of the Comment entity. +// If the Comment object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *CommentMutation) OldClient(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldClient is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldClient requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldClient: %w", err) + } + return oldValue.Client, nil +} + +// 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 *CommentMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case comment.FieldUniqueInt: + return m.OldUniqueInt(ctx) + case comment.FieldUniqueFloat: + return m.OldUniqueFloat(ctx) + case comment.FieldNillableInt: + return m.OldNillableInt(ctx) + case comment.FieldTable: + return m.OldTable(ctx) + case comment.FieldDir: + return m.OldDir(ctx) + case comment.FieldClient: + return m.OldClient(ctx) + } + return nil, fmt.Errorf("unknown Comment field %s", name) +} + +// DocumentMutation represents an operation that mutates the Document nodes in the graph. +type DocumentMutation struct { + document.Mutation + config + id *int + done bool + oldValue func(context.Context) (*Document, error) +} + +var _ ent.Mutation = (*DocumentMutation)(nil) + +// documentOption allows management of the mutation configuration using functional options. +type documentOption func(*DocumentMutation) + +// newDocumentMutation creates new mutation for the Document entity. +func newDocumentMutation(c config, op Op, opts ...documentOption) *DocumentMutation { + m := &DocumentMutation{ + Mutation: *document.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *DocumentMutation) ID() (id int, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withDocumentID sets the ID field of the mutation. +func withDocumentID(id int) documentOption { + return func(m *DocumentMutation) { + var ( + err error + once sync.Once + value *Document + ) + m.oldValue = func(ctx context.Context) (*Document, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Document.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withDocument sets the old Document of the mutation. +func withDocument(node *Document) documentOption { + return func(m *DocumentMutation) { + m.oldValue = func(context.Context) (*Document, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m DocumentMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m DocumentMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *DocumentMutation) IDs(ctx context.Context) ([]int, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []int{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().Document.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldName returns the old "name" field's value of the Document entity. +// If the Document object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DocumentMutation) OldName(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// OldAttachment returns the old "attachment" field's value of the Document entity. +// If the Document object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DocumentMutation) OldAttachment(ctx context.Context) (v []byte, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldAttachment is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldAttachment requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAttachment: %w", err) + } + return oldValue.Attachment, nil +} + +// OldMetadata returns the old "metadata" field's value of the Document entity. +// If the Document object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DocumentMutation) OldMetadata(ctx context.Context) (v []byte, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldMetadata is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldMetadata requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMetadata: %w", err) + } + return oldValue.Metadata, nil +} + +// OldPayload returns the old "payload" field's value of the Document entity. +// If the Document object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DocumentMutation) OldPayload(ctx context.Context) (v *schema.DocPayload, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldPayload is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldPayload requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPayload: %w", err) + } + return oldValue.Payload, nil +} + +// OldDescription returns the old "description" field's value of the Document entity. +// If the Document object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DocumentMutation) OldDescription(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldDescription is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldDescription requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDescription: %w", err) + } + return oldValue.Description, nil +} + +// 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 *DocumentMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case document.FieldName: + return m.OldName(ctx) + case document.FieldAttachment: + return m.OldAttachment(ctx) + case document.FieldMetadata: + return m.OldMetadata(ctx) + case document.FieldPayload: + return m.OldPayload(ctx) + case document.FieldDescription: + return m.OldDescription(ctx) + } + return nil, fmt.Errorf("unknown Document field %s", name) +} + +// ExValueScanMutation represents an operation that mutates the ExValueScan nodes in the graph. +type ExValueScanMutation struct { + exvaluescan.Mutation + config + id *int + done bool + oldValue func(context.Context) (*ExValueScan, error) +} + +var _ ent.Mutation = (*ExValueScanMutation)(nil) + +// exvaluescanOption allows management of the mutation configuration using functional options. +type exvaluescanOption func(*ExValueScanMutation) + +// newExValueScanMutation creates new mutation for the ExValueScan entity. +func newExValueScanMutation(c config, op Op, opts ...exvaluescanOption) *ExValueScanMutation { + m := &ExValueScanMutation{ + Mutation: *exvaluescan.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *ExValueScanMutation) ID() (id int, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withExValueScanID sets the ID field of the mutation. +func withExValueScanID(id int) exvaluescanOption { + return func(m *ExValueScanMutation) { + var ( + err error + once sync.Once + value *ExValueScan + ) + m.oldValue = func(ctx context.Context) (*ExValueScan, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().ExValueScan.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withExValueScan sets the old ExValueScan of the mutation. +func withExValueScan(node *ExValueScan) exvaluescanOption { + return func(m *ExValueScanMutation) { + m.oldValue = func(context.Context) (*ExValueScan, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m ExValueScanMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m ExValueScanMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *ExValueScanMutation) IDs(ctx context.Context) ([]int, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []int{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().ExValueScan.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldBinary returns the old "binary" field's value of the ExValueScan entity. +// If the ExValueScan object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *ExValueScanMutation) OldBinary(ctx context.Context) (v *url.URL, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldBinary is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldBinary requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldBinary: %w", err) + } + return oldValue.Binary, nil +} + +// OldBinaryBytes returns the old "binary_bytes" field's value of the ExValueScan entity. +// If the ExValueScan object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *ExValueScanMutation) OldBinaryBytes(ctx context.Context) (v *url.URL, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldBinaryBytes is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldBinaryBytes requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldBinaryBytes: %w", err) + } + return oldValue.BinaryBytes, nil +} + +// OldBinaryOptional returns the old "binary_optional" field's value of the ExValueScan entity. +// If the ExValueScan object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *ExValueScanMutation) OldBinaryOptional(ctx context.Context) (v *url.URL, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldBinaryOptional is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldBinaryOptional requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldBinaryOptional: %w", err) + } + return oldValue.BinaryOptional, nil +} + +// OldText returns the old "text" field's value of the ExValueScan entity. +// If the ExValueScan object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *ExValueScanMutation) OldText(ctx context.Context) (v *big.Int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldText is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldText requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldText: %w", err) + } + return oldValue.Text, nil +} + +// OldTextOptional returns the old "text_optional" field's value of the ExValueScan entity. +// If the ExValueScan object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *ExValueScanMutation) OldTextOptional(ctx context.Context) (v *big.Int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldTextOptional is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldTextOptional requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTextOptional: %w", err) + } + return oldValue.TextOptional, nil +} + +// OldBase64 returns the old "base64" field's value of the ExValueScan entity. +// If the ExValueScan object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *ExValueScanMutation) OldBase64(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldBase64 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldBase64 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldBase64: %w", err) + } + return oldValue.Base64, nil +} + +// OldCustom returns the old "custom" field's value of the ExValueScan entity. +// If the ExValueScan object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *ExValueScanMutation) OldCustom(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldCustom is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldCustom requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCustom: %w", err) + } + return oldValue.Custom, nil +} + +// OldCustomOptional returns the old "custom_optional" field's value of the ExValueScan entity. +// If the ExValueScan object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *ExValueScanMutation) OldCustomOptional(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldCustomOptional is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldCustomOptional requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCustomOptional: %w", err) + } + return oldValue.CustomOptional, nil +} + +// 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 *ExValueScanMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case exvaluescan.FieldBinary: + return m.OldBinary(ctx) + case exvaluescan.FieldBinaryBytes: + return m.OldBinaryBytes(ctx) + case exvaluescan.FieldBinaryOptional: + return m.OldBinaryOptional(ctx) + case exvaluescan.FieldText: + return m.OldText(ctx) + case exvaluescan.FieldTextOptional: + return m.OldTextOptional(ctx) + case exvaluescan.FieldBase64: + return m.OldBase64(ctx) + case exvaluescan.FieldCustom: + return m.OldCustom(ctx) + case exvaluescan.FieldCustomOptional: + return m.OldCustomOptional(ctx) + } + return nil, fmt.Errorf("unknown ExValueScan field %s", name) +} + +// FieldTypeMutation represents an operation that mutates the FieldType nodes in the graph. +type FieldTypeMutation struct { + fieldtype.Mutation + config + id *int + done bool + oldValue func(context.Context) (*FieldType, error) +} + +var _ ent.Mutation = (*FieldTypeMutation)(nil) + +// fieldtypeOption allows management of the mutation configuration using functional options. +type fieldtypeOption func(*FieldTypeMutation) + +// newFieldTypeMutation creates new mutation for the FieldType entity. +func newFieldTypeMutation(c config, op Op, opts ...fieldtypeOption) *FieldTypeMutation { + m := &FieldTypeMutation{ + Mutation: *fieldtype.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *FieldTypeMutation) ID() (id int, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withFieldTypeID sets the ID field of the mutation. +func withFieldTypeID(id int) fieldtypeOption { + return func(m *FieldTypeMutation) { + var ( + err error + once sync.Once + value *FieldType + ) + m.oldValue = func(ctx context.Context) (*FieldType, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().FieldType.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withFieldType sets the old FieldType of the mutation. +func withFieldType(node *FieldType) fieldtypeOption { + return func(m *FieldTypeMutation) { + m.oldValue = func(context.Context) (*FieldType, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m FieldTypeMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m FieldTypeMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *FieldTypeMutation) IDs(ctx context.Context) ([]int, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []int{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().FieldType.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldInt returns the old "int" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldInt(ctx context.Context) (v int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldInt is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldInt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldInt: %w", err) + } + return oldValue.Int, nil +} + +// OldInt8 returns the old "int8" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldInt8(ctx context.Context) (v int8, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldInt8 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldInt8 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldInt8: %w", err) + } + return oldValue.Int8, nil +} + +// OldInt16 returns the old "int16" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldInt16(ctx context.Context) (v int16, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldInt16 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldInt16 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldInt16: %w", err) + } + return oldValue.Int16, nil +} + +// OldInt32 returns the old "int32" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldInt32(ctx context.Context) (v int32, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldInt32 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldInt32 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldInt32: %w", err) + } + return oldValue.Int32, nil +} + +// OldInt64 returns the old "int64" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldInt64(ctx context.Context) (v int64, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldInt64 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldInt64 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldInt64: %w", err) + } + return oldValue.Int64, nil +} + +// OldOptionalInt returns the old "optional_int" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldOptionalInt(ctx context.Context) (v int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalInt is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalInt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalInt: %w", err) + } + return oldValue.OptionalInt, nil +} + +// OldOptionalInt8 returns the old "optional_int8" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldOptionalInt8(ctx context.Context) (v int8, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalInt8 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalInt8 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalInt8: %w", err) + } + return oldValue.OptionalInt8, nil +} + +// OldOptionalInt16 returns the old "optional_int16" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldOptionalInt16(ctx context.Context) (v int16, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalInt16 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalInt16 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalInt16: %w", err) + } + return oldValue.OptionalInt16, nil +} + +// OldOptionalInt32 returns the old "optional_int32" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldOptionalInt32(ctx context.Context) (v int32, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalInt32 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalInt32 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalInt32: %w", err) + } + return oldValue.OptionalInt32, nil +} + +// OldOptionalInt64 returns the old "optional_int64" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldOptionalInt64(ctx context.Context) (v int64, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalInt64 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalInt64 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalInt64: %w", err) + } + return oldValue.OptionalInt64, nil +} + +// OldNillableInt returns the old "nillable_int" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldNillableInt(ctx context.Context) (v *int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNillableInt is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNillableInt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNillableInt: %w", err) + } + return oldValue.NillableInt, nil +} + +// OldNillableInt8 returns the old "nillable_int8" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldNillableInt8(ctx context.Context) (v *int8, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNillableInt8 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNillableInt8 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNillableInt8: %w", err) + } + return oldValue.NillableInt8, nil +} + +// OldNillableInt16 returns the old "nillable_int16" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldNillableInt16(ctx context.Context) (v *int16, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNillableInt16 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNillableInt16 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNillableInt16: %w", err) + } + return oldValue.NillableInt16, nil +} + +// OldNillableInt32 returns the old "nillable_int32" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldNillableInt32(ctx context.Context) (v *int32, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNillableInt32 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNillableInt32 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNillableInt32: %w", err) + } + return oldValue.NillableInt32, nil +} + +// OldNillableInt64 returns the old "nillable_int64" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldNillableInt64(ctx context.Context) (v *int64, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNillableInt64 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNillableInt64 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNillableInt64: %w", err) + } + return oldValue.NillableInt64, nil +} + +// OldValidateOptionalInt32 returns the old "validate_optional_int32" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldValidateOptionalInt32(ctx context.Context) (v int32, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldValidateOptionalInt32 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldValidateOptionalInt32 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldValidateOptionalInt32: %w", err) + } + return oldValue.ValidateOptionalInt32, nil +} + +// OldOptionalUint returns the old "optional_uint" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldOptionalUint(ctx context.Context) (v uint, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalUint is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalUint requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalUint: %w", err) + } + return oldValue.OptionalUint, nil +} + +// OldOptionalUint8 returns the old "optional_uint8" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldOptionalUint8(ctx context.Context) (v uint8, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalUint8 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalUint8 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalUint8: %w", err) + } + return oldValue.OptionalUint8, nil +} + +// OldOptionalUint16 returns the old "optional_uint16" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldOptionalUint16(ctx context.Context) (v uint16, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalUint16 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalUint16 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalUint16: %w", err) + } + return oldValue.OptionalUint16, nil +} + +// OldOptionalUint32 returns the old "optional_uint32" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldOptionalUint32(ctx context.Context) (v uint32, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalUint32 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalUint32 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalUint32: %w", err) + } + return oldValue.OptionalUint32, nil +} + +// OldOptionalUint64 returns the old "optional_uint64" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldOptionalUint64(ctx context.Context) (v uint64, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalUint64 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalUint64 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalUint64: %w", err) + } + return oldValue.OptionalUint64, nil +} + +// OldState returns the old "state" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldState(ctx context.Context) (v fieldtype.State, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldState is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldState requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldState: %w", err) + } + return oldValue.State, nil +} + +// OldOptionalFloat returns the old "optional_float" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldOptionalFloat(ctx context.Context) (v float64, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalFloat is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalFloat requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalFloat: %w", err) + } + return oldValue.OptionalFloat, nil +} + +// OldOptionalFloat32 returns the old "optional_float32" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldOptionalFloat32(ctx context.Context) (v float32, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalFloat32 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalFloat32 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalFloat32: %w", err) + } + return oldValue.OptionalFloat32, nil +} + +// OldText returns the old "text" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldText(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldText is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldText requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldText: %w", err) + } + return oldValue.Text, nil +} + +// OldDatetime returns the old "datetime" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldDatetime(ctx context.Context) (v time.Time, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldDatetime is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldDatetime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDatetime: %w", err) + } + return oldValue.Datetime, nil +} + +// OldDecimal returns the old "decimal" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldDecimal(ctx context.Context) (v float64, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldDecimal is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldDecimal requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDecimal: %w", err) + } + return oldValue.Decimal, nil +} + +// OldLinkOther returns the old "link_other" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldLinkOther(ctx context.Context) (v *schema.Link, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldLinkOther is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldLinkOther requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLinkOther: %w", err) + } + return oldValue.LinkOther, nil +} + +// OldLinkOtherFunc returns the old "link_other_func" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldLinkOtherFunc(ctx context.Context) (v *schema.Link, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldLinkOtherFunc is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldLinkOtherFunc requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLinkOtherFunc: %w", err) + } + return oldValue.LinkOtherFunc, nil +} + +// OldMAC returns the old "mac" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldMAC(ctx context.Context) (v schema.MAC, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldMAC is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldMAC requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMAC: %w", err) + } + return oldValue.MAC, nil +} + +// OldStringArray returns the old "string_array" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldStringArray(ctx context.Context) (v schema.Strings, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldStringArray is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldStringArray requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldStringArray: %w", err) + } + return oldValue.StringArray, nil +} + +// OldPassword returns the old "password" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldPassword(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldPassword is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldPassword requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPassword: %w", err) + } + return oldValue.Password, nil +} + +// OldStringScanner returns the old "string_scanner" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldStringScanner(ctx context.Context) (v *schema.StringScanner, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldStringScanner is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldStringScanner requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldStringScanner: %w", err) + } + return oldValue.StringScanner, nil +} + +// OldDuration returns the old "duration" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldDuration(ctx context.Context) (v time.Duration, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldDuration is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldDuration requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDuration: %w", err) + } + return oldValue.Duration, nil +} + +// OldDir returns the old "dir" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldDir(ctx context.Context) (v http.Dir, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldDir is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldDir requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDir: %w", err) + } + return oldValue.Dir, nil +} + +// OldNdir returns the old "ndir" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldNdir(ctx context.Context) (v *http.Dir, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNdir is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNdir requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNdir: %w", err) + } + return oldValue.Ndir, nil +} + +// OldStr returns the old "str" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldStr(ctx context.Context) (v sql.NullString, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldStr is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldStr requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldStr: %w", err) + } + return oldValue.Str, nil +} + +// OldNullStr returns the old "null_str" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldNullStr(ctx context.Context) (v *sql.NullString, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNullStr is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNullStr requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNullStr: %w", err) + } + return oldValue.NullStr, nil +} + +// OldLink returns the old "link" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldLink(ctx context.Context) (v schema.Link, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldLink is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldLink requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLink: %w", err) + } + return oldValue.Link, nil +} + +// OldNullLink returns the old "null_link" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldNullLink(ctx context.Context) (v *schema.Link, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNullLink is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNullLink requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNullLink: %w", err) + } + return oldValue.NullLink, nil +} + +// OldActive returns the old "active" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldActive(ctx context.Context) (v schema.Status, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldActive is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldActive requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldActive: %w", err) + } + return oldValue.Active, nil +} + +// OldNullActive returns the old "null_active" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldNullActive(ctx context.Context) (v *schema.Status, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNullActive is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNullActive requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNullActive: %w", err) + } + return oldValue.NullActive, nil +} + +// OldDeleted returns the old "deleted" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldDeleted(ctx context.Context) (v *sql.NullBool, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldDeleted is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldDeleted requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeleted: %w", err) + } + return oldValue.Deleted, nil +} + +// OldDeletedAt returns the old "deleted_at" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldDeletedAt(ctx context.Context) (v *sql.NullTime, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// OldRawData returns the old "raw_data" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldRawData(ctx context.Context) (v []byte, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldRawData is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldRawData requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRawData: %w", err) + } + return oldValue.RawData, nil +} + +// OldSensitive returns the old "sensitive" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldSensitive(ctx context.Context) (v []byte, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldSensitive is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldSensitive requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSensitive: %w", err) + } + return oldValue.Sensitive, nil +} + +// OldIP returns the old "ip" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldIP(ctx context.Context) (v net.IP, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldIP is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldIP requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldIP: %w", err) + } + return oldValue.IP, nil +} + +// OldNullInt64 returns the old "null_int64" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldNullInt64(ctx context.Context) (v *sql.NullInt64, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNullInt64 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNullInt64 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNullInt64: %w", err) + } + return oldValue.NullInt64, nil +} + +// OldSchemaInt returns the old "schema_int" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldSchemaInt(ctx context.Context) (v schema.Int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldSchemaInt is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldSchemaInt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSchemaInt: %w", err) + } + return oldValue.SchemaInt, nil +} + +// OldSchemaInt8 returns the old "schema_int8" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldSchemaInt8(ctx context.Context) (v schema.Int8, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldSchemaInt8 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldSchemaInt8 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSchemaInt8: %w", err) + } + return oldValue.SchemaInt8, nil +} + +// OldSchemaInt64 returns the old "schema_int64" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldSchemaInt64(ctx context.Context) (v schema.Int64, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldSchemaInt64 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldSchemaInt64 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSchemaInt64: %w", err) + } + return oldValue.SchemaInt64, nil +} + +// OldSchemaFloat returns the old "schema_float" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldSchemaFloat(ctx context.Context) (v schema.Float64, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldSchemaFloat is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldSchemaFloat requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSchemaFloat: %w", err) + } + return oldValue.SchemaFloat, nil +} + +// OldSchemaFloat32 returns the old "schema_float32" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldSchemaFloat32(ctx context.Context) (v schema.Float32, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldSchemaFloat32 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldSchemaFloat32 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSchemaFloat32: %w", err) + } + return oldValue.SchemaFloat32, nil +} + +// OldNullFloat returns the old "null_float" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldNullFloat(ctx context.Context) (v *sql.NullFloat64, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNullFloat is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNullFloat requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNullFloat: %w", err) + } + return oldValue.NullFloat, nil +} + +// OldRole returns the old "role" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldRole(ctx context.Context) (v role.Role, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldRole is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldRole requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRole: %w", err) + } + return oldValue.Role, nil +} + +// OldPriority returns the old "priority" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldPriority(ctx context.Context) (v role.Priority, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldPriority is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldPriority requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPriority: %w", err) + } + return oldValue.Priority, nil +} + +// OldOptionalUUID returns the old "optional_uuid" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldOptionalUUID(ctx context.Context) (v uuid.UUID, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalUUID is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalUUID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalUUID: %w", err) + } + return oldValue.OptionalUUID, nil +} + +// OldNillableUUID returns the old "nillable_uuid" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldNillableUUID(ctx context.Context) (v *uuid.UUID, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNillableUUID is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNillableUUID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNillableUUID: %w", err) + } + return oldValue.NillableUUID, nil +} + +// OldStrings returns the old "strings" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldStrings(ctx context.Context) (v []string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldStrings is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldStrings requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldStrings: %w", err) + } + return oldValue.Strings, nil +} + +// OldPair returns the old "pair" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldPair(ctx context.Context) (v schema.Pair, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldPair is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldPair requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPair: %w", err) + } + return oldValue.Pair, nil +} + +// OldNilPair returns the old "nil_pair" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldNilPair(ctx context.Context) (v *schema.Pair, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNilPair is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNilPair requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNilPair: %w", err) + } + return oldValue.NilPair, nil +} + +// OldVstring returns the old "vstring" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldVstring(ctx context.Context) (v schema.VString, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldVstring is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldVstring requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldVstring: %w", err) + } + return oldValue.Vstring, nil +} + +// OldTriple returns the old "triple" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldTriple(ctx context.Context) (v schema.Triple, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldTriple is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldTriple requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTriple: %w", err) + } + return oldValue.Triple, nil +} + +// OldBigInt returns the old "big_int" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldBigInt(ctx context.Context) (v schema.BigInt, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldBigInt is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldBigInt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldBigInt: %w", err) + } + return oldValue.BigInt, nil +} + +// OldPasswordOther returns the old "password_other" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldPasswordOther(ctx context.Context) (v schema.Password, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldPasswordOther is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldPasswordOther requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPasswordOther: %w", err) + } + return oldValue.PasswordOther, nil +} + +// 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 *FieldTypeMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case fieldtype.FieldInt: + return m.OldInt(ctx) + case fieldtype.FieldInt8: + return m.OldInt8(ctx) + case fieldtype.FieldInt16: + return m.OldInt16(ctx) + case fieldtype.FieldInt32: + return m.OldInt32(ctx) + case fieldtype.FieldInt64: + return m.OldInt64(ctx) + case fieldtype.FieldOptionalInt: + return m.OldOptionalInt(ctx) + case fieldtype.FieldOptionalInt8: + return m.OldOptionalInt8(ctx) + case fieldtype.FieldOptionalInt16: + return m.OldOptionalInt16(ctx) + case fieldtype.FieldOptionalInt32: + return m.OldOptionalInt32(ctx) + case fieldtype.FieldOptionalInt64: + return m.OldOptionalInt64(ctx) + case fieldtype.FieldNillableInt: + return m.OldNillableInt(ctx) + case fieldtype.FieldNillableInt8: + return m.OldNillableInt8(ctx) + case fieldtype.FieldNillableInt16: + return m.OldNillableInt16(ctx) + case fieldtype.FieldNillableInt32: + return m.OldNillableInt32(ctx) + case fieldtype.FieldNillableInt64: + return m.OldNillableInt64(ctx) + case fieldtype.FieldValidateOptionalInt32: + return m.OldValidateOptionalInt32(ctx) + case fieldtype.FieldOptionalUint: + return m.OldOptionalUint(ctx) + case fieldtype.FieldOptionalUint8: + return m.OldOptionalUint8(ctx) + case fieldtype.FieldOptionalUint16: + return m.OldOptionalUint16(ctx) + case fieldtype.FieldOptionalUint32: + return m.OldOptionalUint32(ctx) + case fieldtype.FieldOptionalUint64: + return m.OldOptionalUint64(ctx) + case fieldtype.FieldState: + return m.OldState(ctx) + case fieldtype.FieldOptionalFloat: + return m.OldOptionalFloat(ctx) + case fieldtype.FieldOptionalFloat32: + return m.OldOptionalFloat32(ctx) + case fieldtype.FieldText: + return m.OldText(ctx) + case fieldtype.FieldDatetime: + return m.OldDatetime(ctx) + case fieldtype.FieldDecimal: + return m.OldDecimal(ctx) + case fieldtype.FieldLinkOther: + return m.OldLinkOther(ctx) + case fieldtype.FieldLinkOtherFunc: + return m.OldLinkOtherFunc(ctx) + case fieldtype.FieldMAC: + return m.OldMAC(ctx) + case fieldtype.FieldStringArray: + return m.OldStringArray(ctx) + case fieldtype.FieldPassword: + return m.OldPassword(ctx) + case fieldtype.FieldStringScanner: + return m.OldStringScanner(ctx) + case fieldtype.FieldDuration: + return m.OldDuration(ctx) + case fieldtype.FieldDir: + return m.OldDir(ctx) + case fieldtype.FieldNdir: + return m.OldNdir(ctx) + case fieldtype.FieldStr: + return m.OldStr(ctx) + case fieldtype.FieldNullStr: + return m.OldNullStr(ctx) + case fieldtype.FieldLink: + return m.OldLink(ctx) + case fieldtype.FieldNullLink: + return m.OldNullLink(ctx) + case fieldtype.FieldActive: + return m.OldActive(ctx) + case fieldtype.FieldNullActive: + return m.OldNullActive(ctx) + case fieldtype.FieldDeleted: + return m.OldDeleted(ctx) + case fieldtype.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case fieldtype.FieldRawData: + return m.OldRawData(ctx) + case fieldtype.FieldSensitive: + return m.OldSensitive(ctx) + case fieldtype.FieldIP: + return m.OldIP(ctx) + case fieldtype.FieldNullInt64: + return m.OldNullInt64(ctx) + case fieldtype.FieldSchemaInt: + return m.OldSchemaInt(ctx) + case fieldtype.FieldSchemaInt8: + return m.OldSchemaInt8(ctx) + case fieldtype.FieldSchemaInt64: + return m.OldSchemaInt64(ctx) + case fieldtype.FieldSchemaFloat: + return m.OldSchemaFloat(ctx) + case fieldtype.FieldSchemaFloat32: + return m.OldSchemaFloat32(ctx) + case fieldtype.FieldNullFloat: + return m.OldNullFloat(ctx) + case fieldtype.FieldRole: + return m.OldRole(ctx) + case fieldtype.FieldPriority: + return m.OldPriority(ctx) + case fieldtype.FieldOptionalUUID: + return m.OldOptionalUUID(ctx) + case fieldtype.FieldNillableUUID: + return m.OldNillableUUID(ctx) + case fieldtype.FieldStrings: + return m.OldStrings(ctx) + case fieldtype.FieldPair: + return m.OldPair(ctx) + case fieldtype.FieldNilPair: + return m.OldNilPair(ctx) + case fieldtype.FieldVstring: + return m.OldVstring(ctx) + case fieldtype.FieldTriple: + return m.OldTriple(ctx) + case fieldtype.FieldBigInt: + return m.OldBigInt(ctx) + case fieldtype.FieldPasswordOther: + return m.OldPasswordOther(ctx) + } + return nil, fmt.Errorf("unknown FieldType field %s", name) +} + +// FileMutation represents an operation that mutates the File nodes in the graph. +type FileMutation struct { + file.Mutation + config + id *int + done bool + oldValue func(context.Context) (*File, error) +} + +var _ ent.Mutation = (*FileMutation)(nil) + +// fileOption allows management of the mutation configuration using functional options. +type fileOption func(*FileMutation) + +// newFileMutation creates new mutation for the File entity. +func newFileMutation(c config, op Op, opts ...fileOption) *FileMutation { + m := &FileMutation{ + Mutation: *file.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *FileMutation) ID() (id int, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withFileID sets the ID field of the mutation. +func withFileID(id int) fileOption { + return func(m *FileMutation) { + var ( + err error + once sync.Once + value *File + ) + m.oldValue = func(ctx context.Context) (*File, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().File.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withFile sets the old File of the mutation. +func withFile(node *File) fileOption { + return func(m *FileMutation) { + m.oldValue = func(context.Context) (*File, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m FileMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m FileMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *FileMutation) IDs(ctx context.Context) ([]int, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []int{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().File.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldSetID returns the old "set_id" field's value of the File entity. +// If the File object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FileMutation) OldSetID(ctx context.Context) (v int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldSetID is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldSetID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSetID: %w", err) + } + return oldValue.SetID, nil +} + +// OldSize returns the old "size" field's value of the File entity. +// If the File object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FileMutation) OldSize(ctx context.Context) (v int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldSize is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldSize requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSize: %w", err) + } + return oldValue.Size, nil +} + +// OldName returns the old "name" field's value of the File entity. +// If the File object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FileMutation) OldName(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// OldUser returns the old "user" field's value of the File entity. +// If the File object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FileMutation) OldUser(ctx context.Context) (v *string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldUser is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldUser requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUser: %w", err) + } + return oldValue.User, nil +} + +// OldGroup returns the old "group" field's value of the File entity. +// If the File object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FileMutation) OldGroup(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldGroup is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldGroup requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldGroup: %w", err) + } + return oldValue.Group, nil +} + +// OldOp returns the old "op" field's value of the File entity. +// If the File object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FileMutation) OldOp(ctx context.Context) (v bool, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOp is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOp requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOp: %w", err) + } + return oldValue.Op, nil +} + +// OldFieldID returns the old "field_id" field's value of the File entity. +// If the File object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FileMutation) OldFieldID(ctx context.Context) (v int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldFieldID is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldFieldID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldFieldID: %w", err) + } + return oldValue.FieldID, nil +} + +// OldCreateTime returns the old "create_time" field's value of the File entity. +// If the File object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FileMutation) OldCreateTime(ctx context.Context) (v time.Time, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldCreateTime is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldCreateTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreateTime: %w", err) + } + return oldValue.CreateTime, nil +} + +// 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 *FileMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case file.FieldSetID: + return m.OldSetID(ctx) + case file.FieldSize: + return m.OldSize(ctx) + case file.FieldName: + return m.OldName(ctx) + case file.FieldUser: + return m.OldUser(ctx) + case file.FieldGroup: + return m.OldGroup(ctx) + case file.FieldOp: + return m.OldOp(ctx) + case file.FieldFieldID: + return m.OldFieldID(ctx) + case file.FieldCreateTime: + return m.OldCreateTime(ctx) + } + return nil, fmt.Errorf("unknown File field %s", name) +} + +// FileTypeMutation represents an operation that mutates the FileType nodes in the graph. +type FileTypeMutation struct { + filetype.Mutation + config + id *int + done bool + oldValue func(context.Context) (*FileType, error) +} + +var _ ent.Mutation = (*FileTypeMutation)(nil) + +// filetypeOption allows management of the mutation configuration using functional options. +type filetypeOption func(*FileTypeMutation) + +// newFileTypeMutation creates new mutation for the FileType entity. +func newFileTypeMutation(c config, op Op, opts ...filetypeOption) *FileTypeMutation { + m := &FileTypeMutation{ + Mutation: *filetype.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *FileTypeMutation) ID() (id int, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withFileTypeID sets the ID field of the mutation. +func withFileTypeID(id int) filetypeOption { + return func(m *FileTypeMutation) { + var ( + err error + once sync.Once + value *FileType + ) + m.oldValue = func(ctx context.Context) (*FileType, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().FileType.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withFileType sets the old FileType of the mutation. +func withFileType(node *FileType) filetypeOption { + return func(m *FileTypeMutation) { + m.oldValue = func(context.Context) (*FileType, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m FileTypeMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m FileTypeMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *FileTypeMutation) IDs(ctx context.Context) ([]int, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []int{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().FileType.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldName returns the old "name" field's value of the FileType entity. +// If the FileType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FileTypeMutation) OldName(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// OldType returns the old "type" field's value of the FileType entity. +// If the FileType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FileTypeMutation) OldType(ctx context.Context) (v filetype.Type, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldType is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldType requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldType: %w", err) + } + return oldValue.Type, nil +} + +// OldState returns the old "state" field's value of the FileType entity. +// If the FileType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FileTypeMutation) OldState(ctx context.Context) (v filetype.State, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldState is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldState requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldState: %w", err) + } + return oldValue.State, nil +} + +// 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 *FileTypeMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case filetype.FieldName: + return m.OldName(ctx) + case filetype.FieldType: + return m.OldType(ctx) + case filetype.FieldState: + return m.OldState(ctx) + } + return nil, fmt.Errorf("unknown FileType field %s", name) +} + +// GoodsMutation represents an operation that mutates the Goods nodes in the graph. +type GoodsMutation struct { + goods.Mutation + config + id *int + done bool + oldValue func(context.Context) (*Goods, error) +} + +var _ ent.Mutation = (*GoodsMutation)(nil) + +// goodsOption allows management of the mutation configuration using functional options. +type goodsOption func(*GoodsMutation) + +// newGoodsMutation creates new mutation for the Goods entity. +func newGoodsMutation(c config, op Op, opts ...goodsOption) *GoodsMutation { + m := &GoodsMutation{ + Mutation: *goods.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *GoodsMutation) ID() (id int, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withGoodsID sets the ID field of the mutation. +func withGoodsID(id int) goodsOption { + return func(m *GoodsMutation) { + var ( + err error + once sync.Once + value *Goods + ) + m.oldValue = func(ctx context.Context) (*Goods, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Goods.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withGoods sets the old Goods of the mutation. +func withGoods(node *Goods) goodsOption { + return func(m *GoodsMutation) { + m.oldValue = func(context.Context) (*Goods, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m GoodsMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m GoodsMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *GoodsMutation) IDs(ctx context.Context) ([]int, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []int{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().Goods.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// 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 *GoodsMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + return nil, fmt.Errorf("unknown Goods field %s", name) +} + +// GroupMutation represents an operation that mutates the Group nodes in the graph. +type GroupMutation struct { + group.Mutation + config + id *int + done bool + oldValue func(context.Context) (*Group, error) +} + +var _ ent.Mutation = (*GroupMutation)(nil) + +// groupOption allows management of the mutation configuration using functional options. +type groupOption func(*GroupMutation) + +// newGroupMutation creates new mutation for the Group entity. +func newGroupMutation(c config, op Op, opts ...groupOption) *GroupMutation { + m := &GroupMutation{ + Mutation: *group.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *GroupMutation) ID() (id int, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withGroupID sets the ID field of the mutation. +func withGroupID(id int) groupOption { + return func(m *GroupMutation) { + var ( + err error + once sync.Once + value *Group + ) + m.oldValue = func(ctx context.Context) (*Group, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Group.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withGroup sets the old Group of the mutation. +func withGroup(node *Group) groupOption { + return func(m *GroupMutation) { + m.oldValue = func(context.Context) (*Group, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m GroupMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m GroupMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *GroupMutation) IDs(ctx context.Context) ([]int, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []int{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().Group.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldActive returns the old "active" field's value of the Group entity. +// If the Group object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *GroupMutation) OldActive(ctx context.Context) (v bool, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldActive is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldActive requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldActive: %w", err) + } + return oldValue.Active, nil +} + +// OldExpire returns the old "expire" field's value of the Group entity. +// If the Group object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *GroupMutation) OldExpire(ctx context.Context) (v time.Time, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldExpire is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldExpire requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldExpire: %w", err) + } + return oldValue.Expire, nil +} + +// OldType returns the old "type" field's value of the Group entity. +// If the Group object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *GroupMutation) OldType(ctx context.Context) (v *string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldType is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldType requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldType: %w", err) + } + return oldValue.Type, nil +} + +// OldMaxUsers returns the old "max_users" field's value of the Group entity. +// If the Group object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *GroupMutation) OldMaxUsers(ctx context.Context) (v int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldMaxUsers is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldMaxUsers requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMaxUsers: %w", err) + } + return oldValue.MaxUsers, nil +} + +// OldName returns the old "name" field's value of the Group entity. +// If the Group object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *GroupMutation) OldName(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// 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 *GroupMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case group.FieldActive: + return m.OldActive(ctx) + case group.FieldExpire: + return m.OldExpire(ctx) + case group.FieldType: + return m.OldType(ctx) + case group.FieldMaxUsers: + return m.OldMaxUsers(ctx) + case group.FieldName: + return m.OldName(ctx) + } + return nil, fmt.Errorf("unknown Group field %s", name) +} + +// GroupInfoMutation represents an operation that mutates the GroupInfo nodes in the graph. +type GroupInfoMutation struct { + groupinfo.Mutation + config + id *int + done bool + oldValue func(context.Context) (*GroupInfo, error) +} + +var _ ent.Mutation = (*GroupInfoMutation)(nil) + +// groupinfoOption allows management of the mutation configuration using functional options. +type groupinfoOption func(*GroupInfoMutation) + +// newGroupInfoMutation creates new mutation for the GroupInfo entity. +func newGroupInfoMutation(c config, op Op, opts ...groupinfoOption) *GroupInfoMutation { + m := &GroupInfoMutation{ + Mutation: *groupinfo.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *GroupInfoMutation) ID() (id int, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withGroupInfoID sets the ID field of the mutation. +func withGroupInfoID(id int) groupinfoOption { + return func(m *GroupInfoMutation) { + var ( + err error + once sync.Once + value *GroupInfo + ) + m.oldValue = func(ctx context.Context) (*GroupInfo, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().GroupInfo.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withGroupInfo sets the old GroupInfo of the mutation. +func withGroupInfo(node *GroupInfo) groupinfoOption { + return func(m *GroupInfoMutation) { + m.oldValue = func(context.Context) (*GroupInfo, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m GroupInfoMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m GroupInfoMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *GroupInfoMutation) IDs(ctx context.Context) ([]int, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []int{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().GroupInfo.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldDesc returns the old "desc" field's value of the GroupInfo entity. +// If the GroupInfo object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *GroupInfoMutation) OldDesc(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldDesc is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldDesc requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDesc: %w", err) + } + return oldValue.Desc, nil +} + +// OldMaxUsers returns the old "max_users" field's value of the GroupInfo entity. +// If the GroupInfo object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *GroupInfoMutation) OldMaxUsers(ctx context.Context) (v int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldMaxUsers is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldMaxUsers requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMaxUsers: %w", err) + } + return oldValue.MaxUsers, nil +} + +// 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 *GroupInfoMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case groupinfo.FieldDesc: + return m.OldDesc(ctx) + case groupinfo.FieldMaxUsers: + return m.OldMaxUsers(ctx) + } + return nil, fmt.Errorf("unknown GroupInfo field %s", name) +} + +// ItemMutation represents an operation that mutates the Item nodes in the graph. +type ItemMutation struct { + item.Mutation + config + id *string + done bool + oldValue func(context.Context) (*Item, error) +} + +var _ ent.Mutation = (*ItemMutation)(nil) + +// itemOption allows management of the mutation configuration using functional options. +type itemOption func(*ItemMutation) + +// newItemMutation creates new mutation for the Item entity. +func newItemMutation(c config, op Op, opts ...itemOption) *ItemMutation { + m := &ItemMutation{ + Mutation: *item.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of Item entities. +func (m *ItemMutation) SetID(id string) { + m.id = &id +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *ItemMutation) ID() (id string, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withItemID sets the ID field of the mutation. +func withItemID(id string) itemOption { + return func(m *ItemMutation) { + var ( + err error + once sync.Once + value *Item + ) + m.oldValue = func(ctx context.Context) (*Item, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Item.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withItem sets the old Item of the mutation. +func withItem(node *Item) itemOption { + return func(m *ItemMutation) { + m.oldValue = func(context.Context) (*Item, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m ItemMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m ItemMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *ItemMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().Item.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldText returns the old "text" field's value of the Item entity. +// If the Item object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *ItemMutation) OldText(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldText is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldText requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldText: %w", err) + } + return oldValue.Text, nil +} + +// 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 *ItemMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case item.FieldText: + return m.OldText(ctx) + } + return nil, fmt.Errorf("unknown Item field %s", name) +} + +// LicenseMutation represents an operation that mutates the License nodes in the graph. +type LicenseMutation struct { + license.Mutation + config + id *int + done bool + oldValue func(context.Context) (*License, error) +} + +var _ ent.Mutation = (*LicenseMutation)(nil) + +// licenseOption allows management of the mutation configuration using functional options. +type licenseOption func(*LicenseMutation) + +// newLicenseMutation creates new mutation for the License entity. +func newLicenseMutation(c config, op Op, opts ...licenseOption) *LicenseMutation { + m := &LicenseMutation{ + Mutation: *license.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of License entities. +func (m *LicenseMutation) SetID(id int) { + m.id = &id +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *LicenseMutation) ID() (id int, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withLicenseID sets the ID field of the mutation. +func withLicenseID(id int) licenseOption { + return func(m *LicenseMutation) { + var ( + err error + once sync.Once + value *License + ) + m.oldValue = func(ctx context.Context) (*License, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().License.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withLicense sets the old License of the mutation. +func withLicense(node *License) licenseOption { + return func(m *LicenseMutation) { + m.oldValue = func(context.Context) (*License, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m LicenseMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m LicenseMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *LicenseMutation) IDs(ctx context.Context) ([]int, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []int{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().License.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldCreateTime returns the old "create_time" field's value of the License entity. +// If the License object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *LicenseMutation) OldCreateTime(ctx context.Context) (v time.Time, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldCreateTime is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldCreateTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreateTime: %w", err) + } + return oldValue.CreateTime, nil +} + +// OldUpdateTime returns the old "update_time" field's value of the License entity. +// If the License object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *LicenseMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldUpdateTime is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldUpdateTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdateTime: %w", err) + } + return oldValue.UpdateTime, nil +} + +// 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 *LicenseMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case license.FieldCreateTime: + return m.OldCreateTime(ctx) + case license.FieldUpdateTime: + return m.OldUpdateTime(ctx) + } + return nil, fmt.Errorf("unknown License field %s", name) +} + +// NodeMutation represents an operation that mutates the Node nodes in the graph. +type NodeMutation struct { + node.Mutation + config + id *int + done bool + oldValue func(context.Context) (*Node, error) +} + +var _ ent.Mutation = (*NodeMutation)(nil) + +// nodeOption allows management of the mutation configuration using functional options. +type nodeOption func(*NodeMutation) + +// newNodeMutation creates new mutation for the Node entity. +func newNodeMutation(c config, op Op, opts ...nodeOption) *NodeMutation { + m := &NodeMutation{ + Mutation: *node.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *NodeMutation) ID() (id int, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withNodeID sets the ID field of the mutation. +func withNodeID(id int) nodeOption { + return func(m *NodeMutation) { + var ( + err error + once sync.Once + value *Node + ) + m.oldValue = func(ctx context.Context) (*Node, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Node.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withNode sets the old Node of the mutation. +func withNode(node *Node) nodeOption { + return func(m *NodeMutation) { + m.oldValue = func(context.Context) (*Node, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m NodeMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m NodeMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *NodeMutation) IDs(ctx context.Context) ([]int, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []int{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().Node.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldValue returns the old "value" field's value of the Node entity. +// If the Node object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *NodeMutation) OldValue(ctx context.Context) (v int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldValue is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldValue requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldValue: %w", err) + } + return oldValue.Value, nil +} + +// OldUpdatedAt returns the old "updated_at" field's value of the Node entity. +// If the Node object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *NodeMutation) OldUpdatedAt(ctx context.Context) (v *time.Time, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// 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 *NodeMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case node.FieldValue: + return m.OldValue(ctx) + case node.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + } + return nil, fmt.Errorf("unknown Node field %s", name) +} + +// PCMutation represents an operation that mutates the PC nodes in the graph. +type PCMutation struct { + pc.Mutation + config + id *int + done bool + oldValue func(context.Context) (*PC, error) +} + +var _ ent.Mutation = (*PCMutation)(nil) + +// pcOption allows management of the mutation configuration using functional options. +type pcOption func(*PCMutation) + +// newPCMutation creates new mutation for the PC entity. +func newPCMutation(c config, op Op, opts ...pcOption) *PCMutation { + m := &PCMutation{ + Mutation: *pc.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *PCMutation) ID() (id int, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withPCID sets the ID field of the mutation. +func withPCID(id int) pcOption { + return func(m *PCMutation) { + var ( + err error + once sync.Once + value *PC + ) + m.oldValue = func(ctx context.Context) (*PC, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().PC.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withPC sets the old PC of the mutation. +func withPC(node *PC) pcOption { + return func(m *PCMutation) { + m.oldValue = func(context.Context) (*PC, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m PCMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m PCMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *PCMutation) IDs(ctx context.Context) ([]int, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []int{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().PC.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// 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 *PCMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + return nil, fmt.Errorf("unknown PC field %s", name) +} + +// PetMutation represents an operation that mutates the Pet nodes in the graph. +type PetMutation struct { + pet.Mutation + config + id *int + done bool + oldValue func(context.Context) (*Pet, error) +} + +var _ ent.Mutation = (*PetMutation)(nil) + +// petOption allows management of the mutation configuration using functional options. +type petOption func(*PetMutation) + +// newPetMutation creates new mutation for the Pet entity. +func newPetMutation(c config, op Op, opts ...petOption) *PetMutation { + m := &PetMutation{ + Mutation: *pet.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *PetMutation) ID() (id int, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withPetID sets the ID field of the mutation. +func withPetID(id int) petOption { + return func(m *PetMutation) { + var ( + err error + once sync.Once + value *Pet + ) + m.oldValue = func(ctx context.Context) (*Pet, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Pet.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withPet sets the old Pet of the mutation. +func withPet(node *Pet) petOption { + return func(m *PetMutation) { + m.oldValue = func(context.Context) (*Pet, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m PetMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m PetMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *PetMutation) IDs(ctx context.Context) ([]int, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []int{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().Pet.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldAge returns the old "age" field's value of the Pet entity. +// If the Pet object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *PetMutation) OldAge(ctx context.Context) (v float64, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldAge is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldAge requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAge: %w", err) + } + return oldValue.Age, nil +} + +// OldName returns the old "name" field's value of the Pet entity. +// If the Pet object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *PetMutation) OldName(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// OldUUID returns the old "uuid" field's value of the Pet entity. +// If the Pet object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *PetMutation) OldUUID(ctx context.Context) (v uuid.UUID, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldUUID is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldUUID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUUID: %w", err) + } + return oldValue.UUID, nil +} + +// OldNickname returns the old "nickname" field's value of the Pet entity. +// If the Pet object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *PetMutation) OldNickname(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNickname is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNickname requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNickname: %w", err) + } + return oldValue.Nickname, nil +} + +// OldTrained returns the old "trained" field's value of the Pet entity. +// If the Pet object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *PetMutation) OldTrained(ctx context.Context) (v bool, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldTrained is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldTrained requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTrained: %w", err) + } + return oldValue.Trained, nil +} + +// OldOptionalTime returns the old "optional_time" field's value of the Pet entity. +// If the Pet object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *PetMutation) OldOptionalTime(ctx context.Context) (v time.Time, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalTime is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalTime: %w", err) + } + return oldValue.OptionalTime, nil +} + +// 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 *PetMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case pet.FieldAge: + return m.OldAge(ctx) + case pet.FieldName: + return m.OldName(ctx) + case pet.FieldUUID: + return m.OldUUID(ctx) + case pet.FieldNickname: + return m.OldNickname(ctx) + case pet.FieldTrained: + return m.OldTrained(ctx) + case pet.FieldOptionalTime: + return m.OldOptionalTime(ctx) + } + return nil, fmt.Errorf("unknown Pet field %s", name) +} + +// SpecMutation represents an operation that mutates the Spec nodes in the graph. +type SpecMutation struct { + spec.Mutation + config + id *int + done bool + oldValue func(context.Context) (*Spec, error) +} + +var _ ent.Mutation = (*SpecMutation)(nil) + +// specOption allows management of the mutation configuration using functional options. +type specOption func(*SpecMutation) + +// newSpecMutation creates new mutation for the Spec entity. +func newSpecMutation(c config, op Op, opts ...specOption) *SpecMutation { + m := &SpecMutation{ + Mutation: *spec.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *SpecMutation) ID() (id int, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withSpecID sets the ID field of the mutation. +func withSpecID(id int) specOption { + return func(m *SpecMutation) { + var ( + err error + once sync.Once + value *Spec + ) + m.oldValue = func(ctx context.Context) (*Spec, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Spec.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withSpec sets the old Spec of the mutation. +func withSpec(node *Spec) specOption { + return func(m *SpecMutation) { + m.oldValue = func(context.Context) (*Spec, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m SpecMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m SpecMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *SpecMutation) IDs(ctx context.Context) ([]int, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []int{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().Spec.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// 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 *SpecMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + return nil, fmt.Errorf("unknown Spec field %s", name) +} + +// TaskMutation represents an operation that mutates the Task nodes in the graph. +type TaskMutation struct { + enttask.Mutation + config + id *int + done bool + oldValue func(context.Context) (*Task, error) +} + +var _ ent.Mutation = (*TaskMutation)(nil) + +// taskOption allows management of the mutation configuration using functional options. +type taskOption func(*TaskMutation) + +// newTaskMutation creates new mutation for the Task entity. +func newTaskMutation(c config, op Op, opts ...taskOption) *TaskMutation { + m := &TaskMutation{ + Mutation: *enttask.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *TaskMutation) ID() (id int, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withTaskID sets the ID field of the mutation. +func withTaskID(id int) taskOption { + return func(m *TaskMutation) { + var ( + err error + once sync.Once + value *Task + ) + m.oldValue = func(ctx context.Context) (*Task, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Task.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withTask sets the old Task of the mutation. +func withTask(node *Task) taskOption { + return func(m *TaskMutation) { + m.oldValue = func(context.Context) (*Task, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m TaskMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m TaskMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *TaskMutation) IDs(ctx context.Context) ([]int, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []int{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().Task.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldPriority returns the old "priority" field's value of the Task entity. +// If the Task object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *TaskMutation) OldPriority(ctx context.Context) (v task.Priority, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldPriority is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldPriority requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPriority: %w", err) + } + return oldValue.Priority, nil +} + +// OldPriorities returns the old "priorities" field's value of the Task entity. +// If the Task object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *TaskMutation) OldPriorities(ctx context.Context) (v map[string]task.Priority, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldPriorities is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldPriorities requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPriorities: %w", err) + } + return oldValue.Priorities, nil +} + +// OldCreatedAt returns the old "created_at" field's value of the Task entity. +// If the Task object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *TaskMutation) OldCreatedAt(ctx context.Context) (v *time.Time, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// OldName returns the old "name" field's value of the Task entity. +// If the Task object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *TaskMutation) OldName(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// OldOwner returns the old "owner" field's value of the Task entity. +// If the Task object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *TaskMutation) OldOwner(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOwner is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOwner requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwner: %w", err) + } + return oldValue.Owner, nil +} + +// OldOrder returns the old "order" field's value of the Task entity. +// If the Task object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *TaskMutation) OldOrder(ctx context.Context) (v int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOrder is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOrder requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOrder: %w", err) + } + return oldValue.Order, nil +} + +// OldOrderOption returns the old "order_option" field's value of the Task entity. +// If the Task object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *TaskMutation) OldOrderOption(ctx context.Context) (v int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOrderOption is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOrderOption requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOrderOption: %w", err) + } + return oldValue.OrderOption, nil +} + +// OldOp returns the old "op" field's value of the Task entity. +// If the Task object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *TaskMutation) OldOp(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOp is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOp requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOp: %w", err) + } + return oldValue.Op, nil +} + +// 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 *TaskMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case enttask.FieldPriority: + return m.OldPriority(ctx) + case enttask.FieldPriorities: + return m.OldPriorities(ctx) + case enttask.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case enttask.FieldName: + return m.OldName(ctx) + case enttask.FieldOwner: + return m.OldOwner(ctx) + case enttask.FieldOrder: + return m.OldOrder(ctx) + case enttask.FieldOrderOption: + return m.OldOrderOption(ctx) + case enttask.FieldOp: + return m.OldOp(ctx) + } + return nil, fmt.Errorf("unknown Task field %s", name) +} + +// UserMutation represents an operation that mutates the User nodes in the graph. +type UserMutation struct { + user.Mutation + config + id *int + done bool + oldValue func(context.Context) (*User, error) +} + +var _ ent.Mutation = (*UserMutation)(nil) + +// userOption allows management of the mutation configuration using functional options. +type userOption func(*UserMutation) + +// newUserMutation creates new mutation for the User entity. +func newUserMutation(c config, op Op, opts ...userOption) *UserMutation { + m := &UserMutation{ + Mutation: *user.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *UserMutation) ID() (id int, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withUserID sets the ID field of the mutation. +func withUserID(id int) userOption { + return func(m *UserMutation) { + var ( + err error + once sync.Once + value *User + ) + m.oldValue = func(ctx context.Context) (*User, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().User.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withUser sets the old User of the mutation. +func withUser(node *User) userOption { + return func(m *UserMutation) { + m.oldValue = func(context.Context) (*User, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m UserMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m UserMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *UserMutation) IDs(ctx context.Context) ([]int, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []int{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().User.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldOptionalInt returns the old "optional_int" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldOptionalInt(ctx context.Context) (v int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalInt is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalInt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalInt: %w", err) + } + return oldValue.OptionalInt, nil +} + +// OldAge returns the old "age" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldAge(ctx context.Context) (v int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldAge is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldAge requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAge: %w", err) + } + return oldValue.Age, nil +} + +// OldName returns the old "name" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldName(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// OldLast returns the old "last" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldLast(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldLast is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldLast requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLast: %w", err) + } + return oldValue.Last, nil +} + +// OldNickname returns the old "nickname" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldNickname(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNickname is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNickname requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNickname: %w", err) + } + return oldValue.Nickname, nil +} + +// OldAddress returns the old "address" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldAddress(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldAddress is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldAddress requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAddress: %w", err) + } + return oldValue.Address, nil +} + +// OldPhone returns the old "phone" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldPhone(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldPhone is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldPhone requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPhone: %w", err) + } + return oldValue.Phone, nil +} + +// OldPassword returns the old "password" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldPassword is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldPassword requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPassword: %w", err) + } + return oldValue.Password, nil +} + +// OldRole returns the old "role" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldRole(ctx context.Context) (v user.Role, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldRole is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldRole requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRole: %w", err) + } + return oldValue.Role, nil +} + +// OldEmployment returns the old "employment" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldEmployment(ctx context.Context) (v user.Employment, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldEmployment is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldEmployment requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldEmployment: %w", err) + } + return oldValue.Employment, nil +} + +// OldSSOCert returns the old "SSOCert" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldSSOCert(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldSSOCert is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldSSOCert requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSSOCert: %w", err) + } + return oldValue.SSOCert, nil +} + +// OldFilesCount returns the old "files_count" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldFilesCount(ctx context.Context) (v int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldFilesCount is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldFilesCount requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldFilesCount: %w", err) + } + return oldValue.FilesCount, nil +} + +// 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 *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case user.FieldOptionalInt: + return m.OldOptionalInt(ctx) + case user.FieldAge: + return m.OldAge(ctx) + case user.FieldName: + return m.OldName(ctx) + case user.FieldLast: + return m.OldLast(ctx) + case user.FieldNickname: + return m.OldNickname(ctx) + case user.FieldAddress: + return m.OldAddress(ctx) + case user.FieldPhone: + return m.OldPhone(ctx) + case user.FieldPassword: + return m.OldPassword(ctx) + case user.FieldRole: + return m.OldRole(ctx) + case user.FieldEmployment: + return m.OldEmployment(ctx) + case user.FieldSSOCert: + return m.OldSSOCert(ctx) + case user.FieldFilesCount: + return m.OldFilesCount(ctx) + } + return nil, fmt.Errorf("unknown User field %s", name) +} diff --git a/entc/integration/gremlin/ent/fieldtype/where.go b/entc/integration/gremlin/ent/fieldtype/where.go new file mode 100644 index 0000000..72710bf --- /dev/null +++ b/entc/integration/gremlin/ent/fieldtype/where.go @@ -0,0 +1,5108 @@ +// 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 fieldtype + +import ( + "database/sql" + "net" + "net/http" + "time" + + "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/ent/role" + "entgo.io/ent/entc/integration/ent/schema" + "entgo.io/ent/entc/integration/gremlin/ent/predicate" + "github.com/google/uuid" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasID(id) + }) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasID(p.EQ(id)) + }) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasID(p.NEQ(id)) + }) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.FieldType { + return predicate.FieldType(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.FieldType { + return predicate.FieldType(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.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasID(p.GT(id)) + }) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasID(p.GTE(id)) + }) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasID(p.LT(id)) + }) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasID(p.LTE(id)) + }) +} + +// Int applies equality check predicate on the "int" field. It's identical to IntEQ. +func Int(v int) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt, p.EQ(v)) + }) +} + +// Int8 applies equality check predicate on the "int8" field. It's identical to Int8EQ. +func Int8(v int8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt8, p.EQ(v)) + }) +} + +// Int16 applies equality check predicate on the "int16" field. It's identical to Int16EQ. +func Int16(v int16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt16, p.EQ(v)) + }) +} + +// Int32 applies equality check predicate on the "int32" field. It's identical to Int32EQ. +func Int32(v int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt32, p.EQ(v)) + }) +} + +// Int64 applies equality check predicate on the "int64" field. It's identical to Int64EQ. +func Int64(v int64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt64, p.EQ(v)) + }) +} + +// OptionalInt applies equality check predicate on the "optional_int" field. It's identical to OptionalIntEQ. +func OptionalInt(v int) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt, p.EQ(v)) + }) +} + +// OptionalInt8 applies equality check predicate on the "optional_int8" field. It's identical to OptionalInt8EQ. +func OptionalInt8(v int8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt8, p.EQ(v)) + }) +} + +// OptionalInt16 applies equality check predicate on the "optional_int16" field. It's identical to OptionalInt16EQ. +func OptionalInt16(v int16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt16, p.EQ(v)) + }) +} + +// OptionalInt32 applies equality check predicate on the "optional_int32" field. It's identical to OptionalInt32EQ. +func OptionalInt32(v int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt32, p.EQ(v)) + }) +} + +// OptionalInt64 applies equality check predicate on the "optional_int64" field. It's identical to OptionalInt64EQ. +func OptionalInt64(v int64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt64, p.EQ(v)) + }) +} + +// NillableInt applies equality check predicate on the "nillable_int" field. It's identical to NillableIntEQ. +func NillableInt(v int) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt, p.EQ(v)) + }) +} + +// NillableInt8 applies equality check predicate on the "nillable_int8" field. It's identical to NillableInt8EQ. +func NillableInt8(v int8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt8, p.EQ(v)) + }) +} + +// NillableInt16 applies equality check predicate on the "nillable_int16" field. It's identical to NillableInt16EQ. +func NillableInt16(v int16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt16, p.EQ(v)) + }) +} + +// NillableInt32 applies equality check predicate on the "nillable_int32" field. It's identical to NillableInt32EQ. +func NillableInt32(v int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt32, p.EQ(v)) + }) +} + +// NillableInt64 applies equality check predicate on the "nillable_int64" field. It's identical to NillableInt64EQ. +func NillableInt64(v int64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt64, p.EQ(v)) + }) +} + +// ValidateOptionalInt32 applies equality check predicate on the "validate_optional_int32" field. It's identical to ValidateOptionalInt32EQ. +func ValidateOptionalInt32(v int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldValidateOptionalInt32, p.EQ(v)) + }) +} + +// OptionalUint applies equality check predicate on the "optional_uint" field. It's identical to OptionalUintEQ. +func OptionalUint(v uint) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint, p.EQ(v)) + }) +} + +// OptionalUint8 applies equality check predicate on the "optional_uint8" field. It's identical to OptionalUint8EQ. +func OptionalUint8(v uint8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint8, p.EQ(v)) + }) +} + +// OptionalUint16 applies equality check predicate on the "optional_uint16" field. It's identical to OptionalUint16EQ. +func OptionalUint16(v uint16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint16, p.EQ(v)) + }) +} + +// OptionalUint32 applies equality check predicate on the "optional_uint32" field. It's identical to OptionalUint32EQ. +func OptionalUint32(v uint32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint32, p.EQ(v)) + }) +} + +// OptionalUint64 applies equality check predicate on the "optional_uint64" field. It's identical to OptionalUint64EQ. +func OptionalUint64(v uint64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint64, p.EQ(v)) + }) +} + +// OptionalFloat applies equality check predicate on the "optional_float" field. It's identical to OptionalFloatEQ. +func OptionalFloat(v float64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalFloat, p.EQ(v)) + }) +} + +// OptionalFloat32 applies equality check predicate on the "optional_float32" field. It's identical to OptionalFloat32EQ. +func OptionalFloat32(v float32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalFloat32, p.EQ(v)) + }) +} + +// Text applies equality check predicate on the "text" field. It's identical to TextEQ. +func Text(v string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldText, p.EQ(v)) + }) +} + +// Datetime applies equality check predicate on the "datetime" field. It's identical to DatetimeEQ. +func Datetime(v time.Time) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDatetime, p.EQ(v)) + }) +} + +// Decimal applies equality check predicate on the "decimal" field. It's identical to DecimalEQ. +func Decimal(v float64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDecimal, p.EQ(v)) + }) +} + +// LinkOther applies equality check predicate on the "link_other" field. It's identical to LinkOtherEQ. +func LinkOther(v *schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLinkOther, p.EQ(v)) + }) +} + +// LinkOtherFunc applies equality check predicate on the "link_other_func" field. It's identical to LinkOtherFuncEQ. +func LinkOtherFunc(v *schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLinkOtherFunc, p.EQ(v)) + }) +} + +// MAC applies equality check predicate on the "mac" field. It's identical to MACEQ. +func MAC(v schema.MAC) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldMAC, p.EQ(v)) + }) +} + +// StringArray applies equality check predicate on the "string_array" field. It's identical to StringArrayEQ. +func StringArray(v schema.Strings) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStringArray, p.EQ(v)) + }) +} + +// Password applies equality check predicate on the "password" field. It's identical to PasswordEQ. +func Password(v string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPassword, p.EQ(v)) + }) +} + +// StringScanner applies equality check predicate on the "string_scanner" field. It's identical to StringScannerEQ. +func StringScanner(v schema.StringScanner) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStringScanner, p.EQ(v)) + }) +} + +// Duration applies equality check predicate on the "duration" field. It's identical to DurationEQ. +func Duration(v time.Duration) predicate.FieldType { + vc := int64(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDuration, p.EQ(vc)) + }) +} + +// Dir applies equality check predicate on the "dir" field. It's identical to DirEQ. +func Dir(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDir, p.EQ(vc)) + }) +} + +// Ndir applies equality check predicate on the "ndir" field. It's identical to NdirEQ. +func Ndir(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNdir, p.EQ(vc)) + }) +} + +// Str applies equality check predicate on the "str" field. It's identical to StrEQ. +func Str(v sql.NullString) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStr, p.EQ(v)) + }) +} + +// NullStr applies equality check predicate on the "null_str" field. It's identical to NullStrEQ. +func NullStr(v *sql.NullString) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullStr, p.EQ(v)) + }) +} + +// Link applies equality check predicate on the "link" field. It's identical to LinkEQ. +func Link(v schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLink, p.EQ(v)) + }) +} + +// NullLink applies equality check predicate on the "null_link" field. It's identical to NullLinkEQ. +func NullLink(v *schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullLink, p.EQ(v)) + }) +} + +// Active applies equality check predicate on the "active" field. It's identical to ActiveEQ. +func Active(v schema.Status) predicate.FieldType { + vc := bool(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldActive, p.EQ(vc)) + }) +} + +// NullActive applies equality check predicate on the "null_active" field. It's identical to NullActiveEQ. +func NullActive(v schema.Status) predicate.FieldType { + vc := bool(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullActive, p.EQ(vc)) + }) +} + +// Deleted applies equality check predicate on the "deleted" field. It's identical to DeletedEQ. +func Deleted(v *sql.NullBool) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDeleted, p.EQ(v)) + }) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v *sql.NullTime) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDeletedAt, p.EQ(v)) + }) +} + +// RawData applies equality check predicate on the "raw_data" field. It's identical to RawDataEQ. +func RawData(v []byte) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldRawData, p.EQ(v)) + }) +} + +// Sensitive applies equality check predicate on the "sensitive" field. It's identical to SensitiveEQ. +func Sensitive(v []byte) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSensitive, p.EQ(v)) + }) +} + +// IP applies equality check predicate on the "ip" field. It's identical to IPEQ. +func IP(v net.IP) predicate.FieldType { + vc := []byte(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldIP, p.EQ(vc)) + }) +} + +// NullInt64 applies equality check predicate on the "null_int64" field. It's identical to NullInt64EQ. +func NullInt64(v *sql.NullInt64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullInt64, p.EQ(v)) + }) +} + +// SchemaInt applies equality check predicate on the "schema_int" field. It's identical to SchemaIntEQ. +func SchemaInt(v schema.Int) predicate.FieldType { + vc := int(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaInt, p.EQ(vc)) + }) +} + +// SchemaInt8 applies equality check predicate on the "schema_int8" field. It's identical to SchemaInt8EQ. +func SchemaInt8(v schema.Int8) predicate.FieldType { + vc := int8(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaInt8, p.EQ(vc)) + }) +} + +// SchemaInt64 applies equality check predicate on the "schema_int64" field. It's identical to SchemaInt64EQ. +func SchemaInt64(v schema.Int64) predicate.FieldType { + vc := int64(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaInt64, p.EQ(vc)) + }) +} + +// SchemaFloat applies equality check predicate on the "schema_float" field. It's identical to SchemaFloatEQ. +func SchemaFloat(v schema.Float64) predicate.FieldType { + vc := float64(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaFloat, p.EQ(vc)) + }) +} + +// SchemaFloat32 applies equality check predicate on the "schema_float32" field. It's identical to SchemaFloat32EQ. +func SchemaFloat32(v schema.Float32) predicate.FieldType { + vc := float32(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaFloat32, p.EQ(vc)) + }) +} + +// NullFloat applies equality check predicate on the "null_float" field. It's identical to NullFloatEQ. +func NullFloat(v *sql.NullFloat64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullFloat, p.EQ(v)) + }) +} + +// OptionalUUID applies equality check predicate on the "optional_uuid" field. It's identical to OptionalUUIDEQ. +func OptionalUUID(v uuid.UUID) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUUID, p.EQ(v)) + }) +} + +// NillableUUID applies equality check predicate on the "nillable_uuid" field. It's identical to NillableUUIDEQ. +func NillableUUID(v uuid.UUID) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableUUID, p.EQ(v)) + }) +} + +// Pair applies equality check predicate on the "pair" field. It's identical to PairEQ. +func Pair(v schema.Pair) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPair, p.EQ(v)) + }) +} + +// NilPair applies equality check predicate on the "nil_pair" field. It's identical to NilPairEQ. +func NilPair(v *schema.Pair) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNilPair, p.EQ(v)) + }) +} + +// Vstring applies equality check predicate on the "vstring" field. It's identical to VstringEQ. +func Vstring(v schema.VString) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldVstring, p.EQ(v)) + }) +} + +// Triple applies equality check predicate on the "triple" field. It's identical to TripleEQ. +func Triple(v schema.Triple) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldTriple, p.EQ(v)) + }) +} + +// BigInt applies equality check predicate on the "big_int" field. It's identical to BigIntEQ. +func BigInt(v schema.BigInt) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldBigInt, p.EQ(v)) + }) +} + +// PasswordOther applies equality check predicate on the "password_other" field. It's identical to PasswordOtherEQ. +func PasswordOther(v schema.Password) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPasswordOther, p.EQ(v)) + }) +} + +// IntEQ applies the EQ predicate on the "int" field. +func IntEQ(v int) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt, p.EQ(v)) + }) +} + +// IntNEQ applies the NEQ predicate on the "int" field. +func IntNEQ(v int) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt, p.NEQ(v)) + }) +} + +// IntIn applies the In predicate on the "int" field. +func IntIn(vs ...int) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt, p.Within(vs...)) + }) +} + +// IntNotIn applies the NotIn predicate on the "int" field. +func IntNotIn(vs ...int) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt, p.Without(vs...)) + }) +} + +// IntGT applies the GT predicate on the "int" field. +func IntGT(v int) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt, p.GT(v)) + }) +} + +// IntGTE applies the GTE predicate on the "int" field. +func IntGTE(v int) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt, p.GTE(v)) + }) +} + +// IntLT applies the LT predicate on the "int" field. +func IntLT(v int) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt, p.LT(v)) + }) +} + +// IntLTE applies the LTE predicate on the "int" field. +func IntLTE(v int) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt, p.LTE(v)) + }) +} + +// Int8EQ applies the EQ predicate on the "int8" field. +func Int8EQ(v int8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt8, p.EQ(v)) + }) +} + +// Int8NEQ applies the NEQ predicate on the "int8" field. +func Int8NEQ(v int8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt8, p.NEQ(v)) + }) +} + +// Int8In applies the In predicate on the "int8" field. +func Int8In(vs ...int8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt8, p.Within(vs...)) + }) +} + +// Int8NotIn applies the NotIn predicate on the "int8" field. +func Int8NotIn(vs ...int8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt8, p.Without(vs...)) + }) +} + +// Int8GT applies the GT predicate on the "int8" field. +func Int8GT(v int8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt8, p.GT(v)) + }) +} + +// Int8GTE applies the GTE predicate on the "int8" field. +func Int8GTE(v int8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt8, p.GTE(v)) + }) +} + +// Int8LT applies the LT predicate on the "int8" field. +func Int8LT(v int8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt8, p.LT(v)) + }) +} + +// Int8LTE applies the LTE predicate on the "int8" field. +func Int8LTE(v int8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt8, p.LTE(v)) + }) +} + +// Int16EQ applies the EQ predicate on the "int16" field. +func Int16EQ(v int16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt16, p.EQ(v)) + }) +} + +// Int16NEQ applies the NEQ predicate on the "int16" field. +func Int16NEQ(v int16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt16, p.NEQ(v)) + }) +} + +// Int16In applies the In predicate on the "int16" field. +func Int16In(vs ...int16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt16, p.Within(vs...)) + }) +} + +// Int16NotIn applies the NotIn predicate on the "int16" field. +func Int16NotIn(vs ...int16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt16, p.Without(vs...)) + }) +} + +// Int16GT applies the GT predicate on the "int16" field. +func Int16GT(v int16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt16, p.GT(v)) + }) +} + +// Int16GTE applies the GTE predicate on the "int16" field. +func Int16GTE(v int16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt16, p.GTE(v)) + }) +} + +// Int16LT applies the LT predicate on the "int16" field. +func Int16LT(v int16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt16, p.LT(v)) + }) +} + +// Int16LTE applies the LTE predicate on the "int16" field. +func Int16LTE(v int16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt16, p.LTE(v)) + }) +} + +// Int32EQ applies the EQ predicate on the "int32" field. +func Int32EQ(v int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt32, p.EQ(v)) + }) +} + +// Int32NEQ applies the NEQ predicate on the "int32" field. +func Int32NEQ(v int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt32, p.NEQ(v)) + }) +} + +// Int32In applies the In predicate on the "int32" field. +func Int32In(vs ...int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt32, p.Within(vs...)) + }) +} + +// Int32NotIn applies the NotIn predicate on the "int32" field. +func Int32NotIn(vs ...int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt32, p.Without(vs...)) + }) +} + +// Int32GT applies the GT predicate on the "int32" field. +func Int32GT(v int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt32, p.GT(v)) + }) +} + +// Int32GTE applies the GTE predicate on the "int32" field. +func Int32GTE(v int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt32, p.GTE(v)) + }) +} + +// Int32LT applies the LT predicate on the "int32" field. +func Int32LT(v int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt32, p.LT(v)) + }) +} + +// Int32LTE applies the LTE predicate on the "int32" field. +func Int32LTE(v int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt32, p.LTE(v)) + }) +} + +// Int64EQ applies the EQ predicate on the "int64" field. +func Int64EQ(v int64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt64, p.EQ(v)) + }) +} + +// Int64NEQ applies the NEQ predicate on the "int64" field. +func Int64NEQ(v int64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt64, p.NEQ(v)) + }) +} + +// Int64In applies the In predicate on the "int64" field. +func Int64In(vs ...int64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt64, p.Within(vs...)) + }) +} + +// Int64NotIn applies the NotIn predicate on the "int64" field. +func Int64NotIn(vs ...int64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt64, p.Without(vs...)) + }) +} + +// Int64GT applies the GT predicate on the "int64" field. +func Int64GT(v int64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt64, p.GT(v)) + }) +} + +// Int64GTE applies the GTE predicate on the "int64" field. +func Int64GTE(v int64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt64, p.GTE(v)) + }) +} + +// Int64LT applies the LT predicate on the "int64" field. +func Int64LT(v int64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt64, p.LT(v)) + }) +} + +// Int64LTE applies the LTE predicate on the "int64" field. +func Int64LTE(v int64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldInt64, p.LTE(v)) + }) +} + +// OptionalIntEQ applies the EQ predicate on the "optional_int" field. +func OptionalIntEQ(v int) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt, p.EQ(v)) + }) +} + +// OptionalIntNEQ applies the NEQ predicate on the "optional_int" field. +func OptionalIntNEQ(v int) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt, p.NEQ(v)) + }) +} + +// OptionalIntIn applies the In predicate on the "optional_int" field. +func OptionalIntIn(vs ...int) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt, p.Within(vs...)) + }) +} + +// OptionalIntNotIn applies the NotIn predicate on the "optional_int" field. +func OptionalIntNotIn(vs ...int) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt, p.Without(vs...)) + }) +} + +// OptionalIntGT applies the GT predicate on the "optional_int" field. +func OptionalIntGT(v int) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt, p.GT(v)) + }) +} + +// OptionalIntGTE applies the GTE predicate on the "optional_int" field. +func OptionalIntGTE(v int) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt, p.GTE(v)) + }) +} + +// OptionalIntLT applies the LT predicate on the "optional_int" field. +func OptionalIntLT(v int) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt, p.LT(v)) + }) +} + +// OptionalIntLTE applies the LTE predicate on the "optional_int" field. +func OptionalIntLTE(v int) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt, p.LTE(v)) + }) +} + +// OptionalIntIsNil applies the IsNil predicate on the "optional_int" field. +func OptionalIntIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldOptionalInt) + }) +} + +// OptionalIntNotNil applies the NotNil predicate on the "optional_int" field. +func OptionalIntNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldOptionalInt) + }) +} + +// OptionalInt8EQ applies the EQ predicate on the "optional_int8" field. +func OptionalInt8EQ(v int8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt8, p.EQ(v)) + }) +} + +// OptionalInt8NEQ applies the NEQ predicate on the "optional_int8" field. +func OptionalInt8NEQ(v int8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt8, p.NEQ(v)) + }) +} + +// OptionalInt8In applies the In predicate on the "optional_int8" field. +func OptionalInt8In(vs ...int8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt8, p.Within(vs...)) + }) +} + +// OptionalInt8NotIn applies the NotIn predicate on the "optional_int8" field. +func OptionalInt8NotIn(vs ...int8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt8, p.Without(vs...)) + }) +} + +// OptionalInt8GT applies the GT predicate on the "optional_int8" field. +func OptionalInt8GT(v int8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt8, p.GT(v)) + }) +} + +// OptionalInt8GTE applies the GTE predicate on the "optional_int8" field. +func OptionalInt8GTE(v int8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt8, p.GTE(v)) + }) +} + +// OptionalInt8LT applies the LT predicate on the "optional_int8" field. +func OptionalInt8LT(v int8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt8, p.LT(v)) + }) +} + +// OptionalInt8LTE applies the LTE predicate on the "optional_int8" field. +func OptionalInt8LTE(v int8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt8, p.LTE(v)) + }) +} + +// OptionalInt8IsNil applies the IsNil predicate on the "optional_int8" field. +func OptionalInt8IsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldOptionalInt8) + }) +} + +// OptionalInt8NotNil applies the NotNil predicate on the "optional_int8" field. +func OptionalInt8NotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldOptionalInt8) + }) +} + +// OptionalInt16EQ applies the EQ predicate on the "optional_int16" field. +func OptionalInt16EQ(v int16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt16, p.EQ(v)) + }) +} + +// OptionalInt16NEQ applies the NEQ predicate on the "optional_int16" field. +func OptionalInt16NEQ(v int16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt16, p.NEQ(v)) + }) +} + +// OptionalInt16In applies the In predicate on the "optional_int16" field. +func OptionalInt16In(vs ...int16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt16, p.Within(vs...)) + }) +} + +// OptionalInt16NotIn applies the NotIn predicate on the "optional_int16" field. +func OptionalInt16NotIn(vs ...int16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt16, p.Without(vs...)) + }) +} + +// OptionalInt16GT applies the GT predicate on the "optional_int16" field. +func OptionalInt16GT(v int16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt16, p.GT(v)) + }) +} + +// OptionalInt16GTE applies the GTE predicate on the "optional_int16" field. +func OptionalInt16GTE(v int16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt16, p.GTE(v)) + }) +} + +// OptionalInt16LT applies the LT predicate on the "optional_int16" field. +func OptionalInt16LT(v int16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt16, p.LT(v)) + }) +} + +// OptionalInt16LTE applies the LTE predicate on the "optional_int16" field. +func OptionalInt16LTE(v int16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt16, p.LTE(v)) + }) +} + +// OptionalInt16IsNil applies the IsNil predicate on the "optional_int16" field. +func OptionalInt16IsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldOptionalInt16) + }) +} + +// OptionalInt16NotNil applies the NotNil predicate on the "optional_int16" field. +func OptionalInt16NotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldOptionalInt16) + }) +} + +// OptionalInt32EQ applies the EQ predicate on the "optional_int32" field. +func OptionalInt32EQ(v int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt32, p.EQ(v)) + }) +} + +// OptionalInt32NEQ applies the NEQ predicate on the "optional_int32" field. +func OptionalInt32NEQ(v int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt32, p.NEQ(v)) + }) +} + +// OptionalInt32In applies the In predicate on the "optional_int32" field. +func OptionalInt32In(vs ...int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt32, p.Within(vs...)) + }) +} + +// OptionalInt32NotIn applies the NotIn predicate on the "optional_int32" field. +func OptionalInt32NotIn(vs ...int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt32, p.Without(vs...)) + }) +} + +// OptionalInt32GT applies the GT predicate on the "optional_int32" field. +func OptionalInt32GT(v int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt32, p.GT(v)) + }) +} + +// OptionalInt32GTE applies the GTE predicate on the "optional_int32" field. +func OptionalInt32GTE(v int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt32, p.GTE(v)) + }) +} + +// OptionalInt32LT applies the LT predicate on the "optional_int32" field. +func OptionalInt32LT(v int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt32, p.LT(v)) + }) +} + +// OptionalInt32LTE applies the LTE predicate on the "optional_int32" field. +func OptionalInt32LTE(v int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt32, p.LTE(v)) + }) +} + +// OptionalInt32IsNil applies the IsNil predicate on the "optional_int32" field. +func OptionalInt32IsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldOptionalInt32) + }) +} + +// OptionalInt32NotNil applies the NotNil predicate on the "optional_int32" field. +func OptionalInt32NotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldOptionalInt32) + }) +} + +// OptionalInt64EQ applies the EQ predicate on the "optional_int64" field. +func OptionalInt64EQ(v int64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt64, p.EQ(v)) + }) +} + +// OptionalInt64NEQ applies the NEQ predicate on the "optional_int64" field. +func OptionalInt64NEQ(v int64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt64, p.NEQ(v)) + }) +} + +// OptionalInt64In applies the In predicate on the "optional_int64" field. +func OptionalInt64In(vs ...int64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt64, p.Within(vs...)) + }) +} + +// OptionalInt64NotIn applies the NotIn predicate on the "optional_int64" field. +func OptionalInt64NotIn(vs ...int64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt64, p.Without(vs...)) + }) +} + +// OptionalInt64GT applies the GT predicate on the "optional_int64" field. +func OptionalInt64GT(v int64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt64, p.GT(v)) + }) +} + +// OptionalInt64GTE applies the GTE predicate on the "optional_int64" field. +func OptionalInt64GTE(v int64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt64, p.GTE(v)) + }) +} + +// OptionalInt64LT applies the LT predicate on the "optional_int64" field. +func OptionalInt64LT(v int64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt64, p.LT(v)) + }) +} + +// OptionalInt64LTE applies the LTE predicate on the "optional_int64" field. +func OptionalInt64LTE(v int64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalInt64, p.LTE(v)) + }) +} + +// OptionalInt64IsNil applies the IsNil predicate on the "optional_int64" field. +func OptionalInt64IsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldOptionalInt64) + }) +} + +// OptionalInt64NotNil applies the NotNil predicate on the "optional_int64" field. +func OptionalInt64NotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldOptionalInt64) + }) +} + +// NillableIntEQ applies the EQ predicate on the "nillable_int" field. +func NillableIntEQ(v int) predicate.FieldType { + return predicate.FieldType(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.FieldType { + return predicate.FieldType(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.FieldType { + return predicate.FieldType(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.FieldType { + return predicate.FieldType(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.FieldType { + return predicate.FieldType(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.FieldType { + return predicate.FieldType(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.FieldType { + return predicate.FieldType(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.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt, p.LTE(v)) + }) +} + +// NillableIntIsNil applies the IsNil predicate on the "nillable_int" field. +func NillableIntIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldNillableInt) + }) +} + +// NillableIntNotNil applies the NotNil predicate on the "nillable_int" field. +func NillableIntNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldNillableInt) + }) +} + +// NillableInt8EQ applies the EQ predicate on the "nillable_int8" field. +func NillableInt8EQ(v int8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt8, p.EQ(v)) + }) +} + +// NillableInt8NEQ applies the NEQ predicate on the "nillable_int8" field. +func NillableInt8NEQ(v int8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt8, p.NEQ(v)) + }) +} + +// NillableInt8In applies the In predicate on the "nillable_int8" field. +func NillableInt8In(vs ...int8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt8, p.Within(vs...)) + }) +} + +// NillableInt8NotIn applies the NotIn predicate on the "nillable_int8" field. +func NillableInt8NotIn(vs ...int8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt8, p.Without(vs...)) + }) +} + +// NillableInt8GT applies the GT predicate on the "nillable_int8" field. +func NillableInt8GT(v int8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt8, p.GT(v)) + }) +} + +// NillableInt8GTE applies the GTE predicate on the "nillable_int8" field. +func NillableInt8GTE(v int8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt8, p.GTE(v)) + }) +} + +// NillableInt8LT applies the LT predicate on the "nillable_int8" field. +func NillableInt8LT(v int8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt8, p.LT(v)) + }) +} + +// NillableInt8LTE applies the LTE predicate on the "nillable_int8" field. +func NillableInt8LTE(v int8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt8, p.LTE(v)) + }) +} + +// NillableInt8IsNil applies the IsNil predicate on the "nillable_int8" field. +func NillableInt8IsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldNillableInt8) + }) +} + +// NillableInt8NotNil applies the NotNil predicate on the "nillable_int8" field. +func NillableInt8NotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldNillableInt8) + }) +} + +// NillableInt16EQ applies the EQ predicate on the "nillable_int16" field. +func NillableInt16EQ(v int16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt16, p.EQ(v)) + }) +} + +// NillableInt16NEQ applies the NEQ predicate on the "nillable_int16" field. +func NillableInt16NEQ(v int16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt16, p.NEQ(v)) + }) +} + +// NillableInt16In applies the In predicate on the "nillable_int16" field. +func NillableInt16In(vs ...int16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt16, p.Within(vs...)) + }) +} + +// NillableInt16NotIn applies the NotIn predicate on the "nillable_int16" field. +func NillableInt16NotIn(vs ...int16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt16, p.Without(vs...)) + }) +} + +// NillableInt16GT applies the GT predicate on the "nillable_int16" field. +func NillableInt16GT(v int16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt16, p.GT(v)) + }) +} + +// NillableInt16GTE applies the GTE predicate on the "nillable_int16" field. +func NillableInt16GTE(v int16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt16, p.GTE(v)) + }) +} + +// NillableInt16LT applies the LT predicate on the "nillable_int16" field. +func NillableInt16LT(v int16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt16, p.LT(v)) + }) +} + +// NillableInt16LTE applies the LTE predicate on the "nillable_int16" field. +func NillableInt16LTE(v int16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt16, p.LTE(v)) + }) +} + +// NillableInt16IsNil applies the IsNil predicate on the "nillable_int16" field. +func NillableInt16IsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldNillableInt16) + }) +} + +// NillableInt16NotNil applies the NotNil predicate on the "nillable_int16" field. +func NillableInt16NotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldNillableInt16) + }) +} + +// NillableInt32EQ applies the EQ predicate on the "nillable_int32" field. +func NillableInt32EQ(v int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt32, p.EQ(v)) + }) +} + +// NillableInt32NEQ applies the NEQ predicate on the "nillable_int32" field. +func NillableInt32NEQ(v int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt32, p.NEQ(v)) + }) +} + +// NillableInt32In applies the In predicate on the "nillable_int32" field. +func NillableInt32In(vs ...int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt32, p.Within(vs...)) + }) +} + +// NillableInt32NotIn applies the NotIn predicate on the "nillable_int32" field. +func NillableInt32NotIn(vs ...int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt32, p.Without(vs...)) + }) +} + +// NillableInt32GT applies the GT predicate on the "nillable_int32" field. +func NillableInt32GT(v int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt32, p.GT(v)) + }) +} + +// NillableInt32GTE applies the GTE predicate on the "nillable_int32" field. +func NillableInt32GTE(v int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt32, p.GTE(v)) + }) +} + +// NillableInt32LT applies the LT predicate on the "nillable_int32" field. +func NillableInt32LT(v int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt32, p.LT(v)) + }) +} + +// NillableInt32LTE applies the LTE predicate on the "nillable_int32" field. +func NillableInt32LTE(v int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt32, p.LTE(v)) + }) +} + +// NillableInt32IsNil applies the IsNil predicate on the "nillable_int32" field. +func NillableInt32IsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldNillableInt32) + }) +} + +// NillableInt32NotNil applies the NotNil predicate on the "nillable_int32" field. +func NillableInt32NotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldNillableInt32) + }) +} + +// NillableInt64EQ applies the EQ predicate on the "nillable_int64" field. +func NillableInt64EQ(v int64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt64, p.EQ(v)) + }) +} + +// NillableInt64NEQ applies the NEQ predicate on the "nillable_int64" field. +func NillableInt64NEQ(v int64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt64, p.NEQ(v)) + }) +} + +// NillableInt64In applies the In predicate on the "nillable_int64" field. +func NillableInt64In(vs ...int64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt64, p.Within(vs...)) + }) +} + +// NillableInt64NotIn applies the NotIn predicate on the "nillable_int64" field. +func NillableInt64NotIn(vs ...int64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt64, p.Without(vs...)) + }) +} + +// NillableInt64GT applies the GT predicate on the "nillable_int64" field. +func NillableInt64GT(v int64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt64, p.GT(v)) + }) +} + +// NillableInt64GTE applies the GTE predicate on the "nillable_int64" field. +func NillableInt64GTE(v int64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt64, p.GTE(v)) + }) +} + +// NillableInt64LT applies the LT predicate on the "nillable_int64" field. +func NillableInt64LT(v int64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt64, p.LT(v)) + }) +} + +// NillableInt64LTE applies the LTE predicate on the "nillable_int64" field. +func NillableInt64LTE(v int64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableInt64, p.LTE(v)) + }) +} + +// NillableInt64IsNil applies the IsNil predicate on the "nillable_int64" field. +func NillableInt64IsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldNillableInt64) + }) +} + +// NillableInt64NotNil applies the NotNil predicate on the "nillable_int64" field. +func NillableInt64NotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldNillableInt64) + }) +} + +// ValidateOptionalInt32EQ applies the EQ predicate on the "validate_optional_int32" field. +func ValidateOptionalInt32EQ(v int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldValidateOptionalInt32, p.EQ(v)) + }) +} + +// ValidateOptionalInt32NEQ applies the NEQ predicate on the "validate_optional_int32" field. +func ValidateOptionalInt32NEQ(v int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldValidateOptionalInt32, p.NEQ(v)) + }) +} + +// ValidateOptionalInt32In applies the In predicate on the "validate_optional_int32" field. +func ValidateOptionalInt32In(vs ...int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldValidateOptionalInt32, p.Within(vs...)) + }) +} + +// ValidateOptionalInt32NotIn applies the NotIn predicate on the "validate_optional_int32" field. +func ValidateOptionalInt32NotIn(vs ...int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldValidateOptionalInt32, p.Without(vs...)) + }) +} + +// ValidateOptionalInt32GT applies the GT predicate on the "validate_optional_int32" field. +func ValidateOptionalInt32GT(v int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldValidateOptionalInt32, p.GT(v)) + }) +} + +// ValidateOptionalInt32GTE applies the GTE predicate on the "validate_optional_int32" field. +func ValidateOptionalInt32GTE(v int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldValidateOptionalInt32, p.GTE(v)) + }) +} + +// ValidateOptionalInt32LT applies the LT predicate on the "validate_optional_int32" field. +func ValidateOptionalInt32LT(v int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldValidateOptionalInt32, p.LT(v)) + }) +} + +// ValidateOptionalInt32LTE applies the LTE predicate on the "validate_optional_int32" field. +func ValidateOptionalInt32LTE(v int32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldValidateOptionalInt32, p.LTE(v)) + }) +} + +// ValidateOptionalInt32IsNil applies the IsNil predicate on the "validate_optional_int32" field. +func ValidateOptionalInt32IsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldValidateOptionalInt32) + }) +} + +// ValidateOptionalInt32NotNil applies the NotNil predicate on the "validate_optional_int32" field. +func ValidateOptionalInt32NotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldValidateOptionalInt32) + }) +} + +// OptionalUintEQ applies the EQ predicate on the "optional_uint" field. +func OptionalUintEQ(v uint) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint, p.EQ(v)) + }) +} + +// OptionalUintNEQ applies the NEQ predicate on the "optional_uint" field. +func OptionalUintNEQ(v uint) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint, p.NEQ(v)) + }) +} + +// OptionalUintIn applies the In predicate on the "optional_uint" field. +func OptionalUintIn(vs ...uint) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint, p.Within(vs...)) + }) +} + +// OptionalUintNotIn applies the NotIn predicate on the "optional_uint" field. +func OptionalUintNotIn(vs ...uint) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint, p.Without(vs...)) + }) +} + +// OptionalUintGT applies the GT predicate on the "optional_uint" field. +func OptionalUintGT(v uint) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint, p.GT(v)) + }) +} + +// OptionalUintGTE applies the GTE predicate on the "optional_uint" field. +func OptionalUintGTE(v uint) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint, p.GTE(v)) + }) +} + +// OptionalUintLT applies the LT predicate on the "optional_uint" field. +func OptionalUintLT(v uint) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint, p.LT(v)) + }) +} + +// OptionalUintLTE applies the LTE predicate on the "optional_uint" field. +func OptionalUintLTE(v uint) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint, p.LTE(v)) + }) +} + +// OptionalUintIsNil applies the IsNil predicate on the "optional_uint" field. +func OptionalUintIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldOptionalUint) + }) +} + +// OptionalUintNotNil applies the NotNil predicate on the "optional_uint" field. +func OptionalUintNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldOptionalUint) + }) +} + +// OptionalUint8EQ applies the EQ predicate on the "optional_uint8" field. +func OptionalUint8EQ(v uint8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint8, p.EQ(v)) + }) +} + +// OptionalUint8NEQ applies the NEQ predicate on the "optional_uint8" field. +func OptionalUint8NEQ(v uint8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint8, p.NEQ(v)) + }) +} + +// OptionalUint8In applies the In predicate on the "optional_uint8" field. +func OptionalUint8In(vs ...uint8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint8, p.Within(vs...)) + }) +} + +// OptionalUint8NotIn applies the NotIn predicate on the "optional_uint8" field. +func OptionalUint8NotIn(vs ...uint8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint8, p.Without(vs...)) + }) +} + +// OptionalUint8GT applies the GT predicate on the "optional_uint8" field. +func OptionalUint8GT(v uint8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint8, p.GT(v)) + }) +} + +// OptionalUint8GTE applies the GTE predicate on the "optional_uint8" field. +func OptionalUint8GTE(v uint8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint8, p.GTE(v)) + }) +} + +// OptionalUint8LT applies the LT predicate on the "optional_uint8" field. +func OptionalUint8LT(v uint8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint8, p.LT(v)) + }) +} + +// OptionalUint8LTE applies the LTE predicate on the "optional_uint8" field. +func OptionalUint8LTE(v uint8) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint8, p.LTE(v)) + }) +} + +// OptionalUint8IsNil applies the IsNil predicate on the "optional_uint8" field. +func OptionalUint8IsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldOptionalUint8) + }) +} + +// OptionalUint8NotNil applies the NotNil predicate on the "optional_uint8" field. +func OptionalUint8NotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldOptionalUint8) + }) +} + +// OptionalUint16EQ applies the EQ predicate on the "optional_uint16" field. +func OptionalUint16EQ(v uint16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint16, p.EQ(v)) + }) +} + +// OptionalUint16NEQ applies the NEQ predicate on the "optional_uint16" field. +func OptionalUint16NEQ(v uint16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint16, p.NEQ(v)) + }) +} + +// OptionalUint16In applies the In predicate on the "optional_uint16" field. +func OptionalUint16In(vs ...uint16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint16, p.Within(vs...)) + }) +} + +// OptionalUint16NotIn applies the NotIn predicate on the "optional_uint16" field. +func OptionalUint16NotIn(vs ...uint16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint16, p.Without(vs...)) + }) +} + +// OptionalUint16GT applies the GT predicate on the "optional_uint16" field. +func OptionalUint16GT(v uint16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint16, p.GT(v)) + }) +} + +// OptionalUint16GTE applies the GTE predicate on the "optional_uint16" field. +func OptionalUint16GTE(v uint16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint16, p.GTE(v)) + }) +} + +// OptionalUint16LT applies the LT predicate on the "optional_uint16" field. +func OptionalUint16LT(v uint16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint16, p.LT(v)) + }) +} + +// OptionalUint16LTE applies the LTE predicate on the "optional_uint16" field. +func OptionalUint16LTE(v uint16) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint16, p.LTE(v)) + }) +} + +// OptionalUint16IsNil applies the IsNil predicate on the "optional_uint16" field. +func OptionalUint16IsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldOptionalUint16) + }) +} + +// OptionalUint16NotNil applies the NotNil predicate on the "optional_uint16" field. +func OptionalUint16NotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldOptionalUint16) + }) +} + +// OptionalUint32EQ applies the EQ predicate on the "optional_uint32" field. +func OptionalUint32EQ(v uint32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint32, p.EQ(v)) + }) +} + +// OptionalUint32NEQ applies the NEQ predicate on the "optional_uint32" field. +func OptionalUint32NEQ(v uint32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint32, p.NEQ(v)) + }) +} + +// OptionalUint32In applies the In predicate on the "optional_uint32" field. +func OptionalUint32In(vs ...uint32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint32, p.Within(vs...)) + }) +} + +// OptionalUint32NotIn applies the NotIn predicate on the "optional_uint32" field. +func OptionalUint32NotIn(vs ...uint32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint32, p.Without(vs...)) + }) +} + +// OptionalUint32GT applies the GT predicate on the "optional_uint32" field. +func OptionalUint32GT(v uint32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint32, p.GT(v)) + }) +} + +// OptionalUint32GTE applies the GTE predicate on the "optional_uint32" field. +func OptionalUint32GTE(v uint32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint32, p.GTE(v)) + }) +} + +// OptionalUint32LT applies the LT predicate on the "optional_uint32" field. +func OptionalUint32LT(v uint32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint32, p.LT(v)) + }) +} + +// OptionalUint32LTE applies the LTE predicate on the "optional_uint32" field. +func OptionalUint32LTE(v uint32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint32, p.LTE(v)) + }) +} + +// OptionalUint32IsNil applies the IsNil predicate on the "optional_uint32" field. +func OptionalUint32IsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldOptionalUint32) + }) +} + +// OptionalUint32NotNil applies the NotNil predicate on the "optional_uint32" field. +func OptionalUint32NotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldOptionalUint32) + }) +} + +// OptionalUint64EQ applies the EQ predicate on the "optional_uint64" field. +func OptionalUint64EQ(v uint64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint64, p.EQ(v)) + }) +} + +// OptionalUint64NEQ applies the NEQ predicate on the "optional_uint64" field. +func OptionalUint64NEQ(v uint64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint64, p.NEQ(v)) + }) +} + +// OptionalUint64In applies the In predicate on the "optional_uint64" field. +func OptionalUint64In(vs ...uint64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint64, p.Within(vs...)) + }) +} + +// OptionalUint64NotIn applies the NotIn predicate on the "optional_uint64" field. +func OptionalUint64NotIn(vs ...uint64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint64, p.Without(vs...)) + }) +} + +// OptionalUint64GT applies the GT predicate on the "optional_uint64" field. +func OptionalUint64GT(v uint64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint64, p.GT(v)) + }) +} + +// OptionalUint64GTE applies the GTE predicate on the "optional_uint64" field. +func OptionalUint64GTE(v uint64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint64, p.GTE(v)) + }) +} + +// OptionalUint64LT applies the LT predicate on the "optional_uint64" field. +func OptionalUint64LT(v uint64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint64, p.LT(v)) + }) +} + +// OptionalUint64LTE applies the LTE predicate on the "optional_uint64" field. +func OptionalUint64LTE(v uint64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUint64, p.LTE(v)) + }) +} + +// OptionalUint64IsNil applies the IsNil predicate on the "optional_uint64" field. +func OptionalUint64IsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldOptionalUint64) + }) +} + +// OptionalUint64NotNil applies the NotNil predicate on the "optional_uint64" field. +func OptionalUint64NotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldOptionalUint64) + }) +} + +// StateEQ applies the EQ predicate on the "state" field. +func StateEQ(v State) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldState, p.EQ(v)) + }) +} + +// StateNEQ applies the NEQ predicate on the "state" field. +func StateNEQ(v State) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldState, p.NEQ(v)) + }) +} + +// StateIn applies the In predicate on the "state" field. +func StateIn(vs ...State) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldState, p.Within(vs...)) + }) +} + +// StateNotIn applies the NotIn predicate on the "state" field. +func StateNotIn(vs ...State) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldState, p.Without(vs...)) + }) +} + +// StateIsNil applies the IsNil predicate on the "state" field. +func StateIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldState) + }) +} + +// StateNotNil applies the NotNil predicate on the "state" field. +func StateNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldState) + }) +} + +// OptionalFloatEQ applies the EQ predicate on the "optional_float" field. +func OptionalFloatEQ(v float64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalFloat, p.EQ(v)) + }) +} + +// OptionalFloatNEQ applies the NEQ predicate on the "optional_float" field. +func OptionalFloatNEQ(v float64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalFloat, p.NEQ(v)) + }) +} + +// OptionalFloatIn applies the In predicate on the "optional_float" field. +func OptionalFloatIn(vs ...float64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalFloat, p.Within(vs...)) + }) +} + +// OptionalFloatNotIn applies the NotIn predicate on the "optional_float" field. +func OptionalFloatNotIn(vs ...float64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalFloat, p.Without(vs...)) + }) +} + +// OptionalFloatGT applies the GT predicate on the "optional_float" field. +func OptionalFloatGT(v float64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalFloat, p.GT(v)) + }) +} + +// OptionalFloatGTE applies the GTE predicate on the "optional_float" field. +func OptionalFloatGTE(v float64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalFloat, p.GTE(v)) + }) +} + +// OptionalFloatLT applies the LT predicate on the "optional_float" field. +func OptionalFloatLT(v float64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalFloat, p.LT(v)) + }) +} + +// OptionalFloatLTE applies the LTE predicate on the "optional_float" field. +func OptionalFloatLTE(v float64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalFloat, p.LTE(v)) + }) +} + +// OptionalFloatIsNil applies the IsNil predicate on the "optional_float" field. +func OptionalFloatIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldOptionalFloat) + }) +} + +// OptionalFloatNotNil applies the NotNil predicate on the "optional_float" field. +func OptionalFloatNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldOptionalFloat) + }) +} + +// OptionalFloat32EQ applies the EQ predicate on the "optional_float32" field. +func OptionalFloat32EQ(v float32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalFloat32, p.EQ(v)) + }) +} + +// OptionalFloat32NEQ applies the NEQ predicate on the "optional_float32" field. +func OptionalFloat32NEQ(v float32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalFloat32, p.NEQ(v)) + }) +} + +// OptionalFloat32In applies the In predicate on the "optional_float32" field. +func OptionalFloat32In(vs ...float32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalFloat32, p.Within(vs...)) + }) +} + +// OptionalFloat32NotIn applies the NotIn predicate on the "optional_float32" field. +func OptionalFloat32NotIn(vs ...float32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalFloat32, p.Without(vs...)) + }) +} + +// OptionalFloat32GT applies the GT predicate on the "optional_float32" field. +func OptionalFloat32GT(v float32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalFloat32, p.GT(v)) + }) +} + +// OptionalFloat32GTE applies the GTE predicate on the "optional_float32" field. +func OptionalFloat32GTE(v float32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalFloat32, p.GTE(v)) + }) +} + +// OptionalFloat32LT applies the LT predicate on the "optional_float32" field. +func OptionalFloat32LT(v float32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalFloat32, p.LT(v)) + }) +} + +// OptionalFloat32LTE applies the LTE predicate on the "optional_float32" field. +func OptionalFloat32LTE(v float32) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalFloat32, p.LTE(v)) + }) +} + +// OptionalFloat32IsNil applies the IsNil predicate on the "optional_float32" field. +func OptionalFloat32IsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldOptionalFloat32) + }) +} + +// OptionalFloat32NotNil applies the NotNil predicate on the "optional_float32" field. +func OptionalFloat32NotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldOptionalFloat32) + }) +} + +// TextEQ applies the EQ predicate on the "text" field. +func TextEQ(v string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldText, p.EQ(v)) + }) +} + +// TextNEQ applies the NEQ predicate on the "text" field. +func TextNEQ(v string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldText, p.NEQ(v)) + }) +} + +// TextIn applies the In predicate on the "text" field. +func TextIn(vs ...string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldText, p.Within(vs...)) + }) +} + +// TextNotIn applies the NotIn predicate on the "text" field. +func TextNotIn(vs ...string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldText, p.Without(vs...)) + }) +} + +// TextGT applies the GT predicate on the "text" field. +func TextGT(v string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldText, p.GT(v)) + }) +} + +// TextGTE applies the GTE predicate on the "text" field. +func TextGTE(v string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldText, p.GTE(v)) + }) +} + +// TextLT applies the LT predicate on the "text" field. +func TextLT(v string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldText, p.LT(v)) + }) +} + +// TextLTE applies the LTE predicate on the "text" field. +func TextLTE(v string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldText, p.LTE(v)) + }) +} + +// TextContains applies the Contains predicate on the "text" field. +func TextContains(v string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldText, p.Containing(v)) + }) +} + +// TextHasPrefix applies the HasPrefix predicate on the "text" field. +func TextHasPrefix(v string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldText, p.StartingWith(v)) + }) +} + +// TextHasSuffix applies the HasSuffix predicate on the "text" field. +func TextHasSuffix(v string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldText, p.EndingWith(v)) + }) +} + +// TextIsNil applies the IsNil predicate on the "text" field. +func TextIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldText) + }) +} + +// TextNotNil applies the NotNil predicate on the "text" field. +func TextNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldText) + }) +} + +// DatetimeEQ applies the EQ predicate on the "datetime" field. +func DatetimeEQ(v time.Time) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDatetime, p.EQ(v)) + }) +} + +// DatetimeNEQ applies the NEQ predicate on the "datetime" field. +func DatetimeNEQ(v time.Time) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDatetime, p.NEQ(v)) + }) +} + +// DatetimeIn applies the In predicate on the "datetime" field. +func DatetimeIn(vs ...time.Time) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDatetime, p.Within(vs...)) + }) +} + +// DatetimeNotIn applies the NotIn predicate on the "datetime" field. +func DatetimeNotIn(vs ...time.Time) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDatetime, p.Without(vs...)) + }) +} + +// DatetimeGT applies the GT predicate on the "datetime" field. +func DatetimeGT(v time.Time) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDatetime, p.GT(v)) + }) +} + +// DatetimeGTE applies the GTE predicate on the "datetime" field. +func DatetimeGTE(v time.Time) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDatetime, p.GTE(v)) + }) +} + +// DatetimeLT applies the LT predicate on the "datetime" field. +func DatetimeLT(v time.Time) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDatetime, p.LT(v)) + }) +} + +// DatetimeLTE applies the LTE predicate on the "datetime" field. +func DatetimeLTE(v time.Time) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDatetime, p.LTE(v)) + }) +} + +// DatetimeIsNil applies the IsNil predicate on the "datetime" field. +func DatetimeIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldDatetime) + }) +} + +// DatetimeNotNil applies the NotNil predicate on the "datetime" field. +func DatetimeNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldDatetime) + }) +} + +// DecimalEQ applies the EQ predicate on the "decimal" field. +func DecimalEQ(v float64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDecimal, p.EQ(v)) + }) +} + +// DecimalNEQ applies the NEQ predicate on the "decimal" field. +func DecimalNEQ(v float64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDecimal, p.NEQ(v)) + }) +} + +// DecimalIn applies the In predicate on the "decimal" field. +func DecimalIn(vs ...float64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDecimal, p.Within(vs...)) + }) +} + +// DecimalNotIn applies the NotIn predicate on the "decimal" field. +func DecimalNotIn(vs ...float64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDecimal, p.Without(vs...)) + }) +} + +// DecimalGT applies the GT predicate on the "decimal" field. +func DecimalGT(v float64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDecimal, p.GT(v)) + }) +} + +// DecimalGTE applies the GTE predicate on the "decimal" field. +func DecimalGTE(v float64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDecimal, p.GTE(v)) + }) +} + +// DecimalLT applies the LT predicate on the "decimal" field. +func DecimalLT(v float64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDecimal, p.LT(v)) + }) +} + +// DecimalLTE applies the LTE predicate on the "decimal" field. +func DecimalLTE(v float64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDecimal, p.LTE(v)) + }) +} + +// DecimalIsNil applies the IsNil predicate on the "decimal" field. +func DecimalIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldDecimal) + }) +} + +// DecimalNotNil applies the NotNil predicate on the "decimal" field. +func DecimalNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldDecimal) + }) +} + +// LinkOtherEQ applies the EQ predicate on the "link_other" field. +func LinkOtherEQ(v *schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLinkOther, p.EQ(v)) + }) +} + +// LinkOtherNEQ applies the NEQ predicate on the "link_other" field. +func LinkOtherNEQ(v *schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLinkOther, p.NEQ(v)) + }) +} + +// LinkOtherIn applies the In predicate on the "link_other" field. +func LinkOtherIn(vs ...*schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLinkOther, p.Within(vs...)) + }) +} + +// LinkOtherNotIn applies the NotIn predicate on the "link_other" field. +func LinkOtherNotIn(vs ...*schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLinkOther, p.Without(vs...)) + }) +} + +// LinkOtherGT applies the GT predicate on the "link_other" field. +func LinkOtherGT(v *schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLinkOther, p.GT(v)) + }) +} + +// LinkOtherGTE applies the GTE predicate on the "link_other" field. +func LinkOtherGTE(v *schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLinkOther, p.GTE(v)) + }) +} + +// LinkOtherLT applies the LT predicate on the "link_other" field. +func LinkOtherLT(v *schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLinkOther, p.LT(v)) + }) +} + +// LinkOtherLTE applies the LTE predicate on the "link_other" field. +func LinkOtherLTE(v *schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLinkOther, p.LTE(v)) + }) +} + +// LinkOtherIsNil applies the IsNil predicate on the "link_other" field. +func LinkOtherIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldLinkOther) + }) +} + +// LinkOtherNotNil applies the NotNil predicate on the "link_other" field. +func LinkOtherNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldLinkOther) + }) +} + +// LinkOtherFuncEQ applies the EQ predicate on the "link_other_func" field. +func LinkOtherFuncEQ(v *schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLinkOtherFunc, p.EQ(v)) + }) +} + +// LinkOtherFuncNEQ applies the NEQ predicate on the "link_other_func" field. +func LinkOtherFuncNEQ(v *schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLinkOtherFunc, p.NEQ(v)) + }) +} + +// LinkOtherFuncIn applies the In predicate on the "link_other_func" field. +func LinkOtherFuncIn(vs ...*schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLinkOtherFunc, p.Within(vs...)) + }) +} + +// LinkOtherFuncNotIn applies the NotIn predicate on the "link_other_func" field. +func LinkOtherFuncNotIn(vs ...*schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLinkOtherFunc, p.Without(vs...)) + }) +} + +// LinkOtherFuncGT applies the GT predicate on the "link_other_func" field. +func LinkOtherFuncGT(v *schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLinkOtherFunc, p.GT(v)) + }) +} + +// LinkOtherFuncGTE applies the GTE predicate on the "link_other_func" field. +func LinkOtherFuncGTE(v *schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLinkOtherFunc, p.GTE(v)) + }) +} + +// LinkOtherFuncLT applies the LT predicate on the "link_other_func" field. +func LinkOtherFuncLT(v *schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLinkOtherFunc, p.LT(v)) + }) +} + +// LinkOtherFuncLTE applies the LTE predicate on the "link_other_func" field. +func LinkOtherFuncLTE(v *schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLinkOtherFunc, p.LTE(v)) + }) +} + +// LinkOtherFuncIsNil applies the IsNil predicate on the "link_other_func" field. +func LinkOtherFuncIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldLinkOtherFunc) + }) +} + +// LinkOtherFuncNotNil applies the NotNil predicate on the "link_other_func" field. +func LinkOtherFuncNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldLinkOtherFunc) + }) +} + +// MACEQ applies the EQ predicate on the "mac" field. +func MACEQ(v schema.MAC) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldMAC, p.EQ(v)) + }) +} + +// MACNEQ applies the NEQ predicate on the "mac" field. +func MACNEQ(v schema.MAC) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldMAC, p.NEQ(v)) + }) +} + +// MACIn applies the In predicate on the "mac" field. +func MACIn(vs ...schema.MAC) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldMAC, p.Within(vs...)) + }) +} + +// MACNotIn applies the NotIn predicate on the "mac" field. +func MACNotIn(vs ...schema.MAC) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldMAC, p.Without(vs...)) + }) +} + +// MACGT applies the GT predicate on the "mac" field. +func MACGT(v schema.MAC) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldMAC, p.GT(v)) + }) +} + +// MACGTE applies the GTE predicate on the "mac" field. +func MACGTE(v schema.MAC) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldMAC, p.GTE(v)) + }) +} + +// MACLT applies the LT predicate on the "mac" field. +func MACLT(v schema.MAC) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldMAC, p.LT(v)) + }) +} + +// MACLTE applies the LTE predicate on the "mac" field. +func MACLTE(v schema.MAC) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldMAC, p.LTE(v)) + }) +} + +// MACContains applies the Contains predicate on the "mac" field. +func MACContains(v schema.MAC) predicate.FieldType { + vc := v.String() + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldMAC, p.Containing(vc)) + }) +} + +// MACHasPrefix applies the HasPrefix predicate on the "mac" field. +func MACHasPrefix(v schema.MAC) predicate.FieldType { + vc := v.String() + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldMAC, p.StartingWith(vc)) + }) +} + +// MACHasSuffix applies the HasSuffix predicate on the "mac" field. +func MACHasSuffix(v schema.MAC) predicate.FieldType { + vc := v.String() + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldMAC, p.EndingWith(vc)) + }) +} + +// MACIsNil applies the IsNil predicate on the "mac" field. +func MACIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldMAC) + }) +} + +// MACNotNil applies the NotNil predicate on the "mac" field. +func MACNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldMAC) + }) +} + +// StringArrayEQ applies the EQ predicate on the "string_array" field. +func StringArrayEQ(v schema.Strings) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStringArray, p.EQ(v)) + }) +} + +// StringArrayNEQ applies the NEQ predicate on the "string_array" field. +func StringArrayNEQ(v schema.Strings) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStringArray, p.NEQ(v)) + }) +} + +// StringArrayIn applies the In predicate on the "string_array" field. +func StringArrayIn(vs ...schema.Strings) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStringArray, p.Within(vs...)) + }) +} + +// StringArrayNotIn applies the NotIn predicate on the "string_array" field. +func StringArrayNotIn(vs ...schema.Strings) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStringArray, p.Without(vs...)) + }) +} + +// StringArrayGT applies the GT predicate on the "string_array" field. +func StringArrayGT(v schema.Strings) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStringArray, p.GT(v)) + }) +} + +// StringArrayGTE applies the GTE predicate on the "string_array" field. +func StringArrayGTE(v schema.Strings) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStringArray, p.GTE(v)) + }) +} + +// StringArrayLT applies the LT predicate on the "string_array" field. +func StringArrayLT(v schema.Strings) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStringArray, p.LT(v)) + }) +} + +// StringArrayLTE applies the LTE predicate on the "string_array" field. +func StringArrayLTE(v schema.Strings) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStringArray, p.LTE(v)) + }) +} + +// StringArrayIsNil applies the IsNil predicate on the "string_array" field. +func StringArrayIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldStringArray) + }) +} + +// StringArrayNotNil applies the NotNil predicate on the "string_array" field. +func StringArrayNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldStringArray) + }) +} + +// PasswordEQ applies the EQ predicate on the "password" field. +func PasswordEQ(v string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPassword, p.EQ(v)) + }) +} + +// PasswordNEQ applies the NEQ predicate on the "password" field. +func PasswordNEQ(v string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPassword, p.NEQ(v)) + }) +} + +// PasswordIn applies the In predicate on the "password" field. +func PasswordIn(vs ...string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPassword, p.Within(vs...)) + }) +} + +// PasswordNotIn applies the NotIn predicate on the "password" field. +func PasswordNotIn(vs ...string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPassword, p.Without(vs...)) + }) +} + +// PasswordGT applies the GT predicate on the "password" field. +func PasswordGT(v string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPassword, p.GT(v)) + }) +} + +// PasswordGTE applies the GTE predicate on the "password" field. +func PasswordGTE(v string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPassword, p.GTE(v)) + }) +} + +// PasswordLT applies the LT predicate on the "password" field. +func PasswordLT(v string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPassword, p.LT(v)) + }) +} + +// PasswordLTE applies the LTE predicate on the "password" field. +func PasswordLTE(v string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPassword, p.LTE(v)) + }) +} + +// PasswordContains applies the Contains predicate on the "password" field. +func PasswordContains(v string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPassword, p.Containing(v)) + }) +} + +// PasswordHasPrefix applies the HasPrefix predicate on the "password" field. +func PasswordHasPrefix(v string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPassword, p.StartingWith(v)) + }) +} + +// PasswordHasSuffix applies the HasSuffix predicate on the "password" field. +func PasswordHasSuffix(v string) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPassword, p.EndingWith(v)) + }) +} + +// PasswordIsNil applies the IsNil predicate on the "password" field. +func PasswordIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldPassword) + }) +} + +// PasswordNotNil applies the NotNil predicate on the "password" field. +func PasswordNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldPassword) + }) +} + +// StringScannerEQ applies the EQ predicate on the "string_scanner" field. +func StringScannerEQ(v schema.StringScanner) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStringScanner, p.EQ(v)) + }) +} + +// StringScannerNEQ applies the NEQ predicate on the "string_scanner" field. +func StringScannerNEQ(v schema.StringScanner) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStringScanner, p.NEQ(v)) + }) +} + +// StringScannerIn applies the In predicate on the "string_scanner" field. +func StringScannerIn(vs ...schema.StringScanner) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStringScanner, p.Within(vs...)) + }) +} + +// StringScannerNotIn applies the NotIn predicate on the "string_scanner" field. +func StringScannerNotIn(vs ...schema.StringScanner) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStringScanner, p.Without(vs...)) + }) +} + +// StringScannerGT applies the GT predicate on the "string_scanner" field. +func StringScannerGT(v schema.StringScanner) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStringScanner, p.GT(v)) + }) +} + +// StringScannerGTE applies the GTE predicate on the "string_scanner" field. +func StringScannerGTE(v schema.StringScanner) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStringScanner, p.GTE(v)) + }) +} + +// StringScannerLT applies the LT predicate on the "string_scanner" field. +func StringScannerLT(v schema.StringScanner) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStringScanner, p.LT(v)) + }) +} + +// StringScannerLTE applies the LTE predicate on the "string_scanner" field. +func StringScannerLTE(v schema.StringScanner) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStringScanner, p.LTE(v)) + }) +} + +// StringScannerContains applies the Contains predicate on the "string_scanner" field. +func StringScannerContains(v schema.StringScanner) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStringScanner, p.Containing(vc)) + }) +} + +// StringScannerHasPrefix applies the HasPrefix predicate on the "string_scanner" field. +func StringScannerHasPrefix(v schema.StringScanner) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStringScanner, p.StartingWith(vc)) + }) +} + +// StringScannerHasSuffix applies the HasSuffix predicate on the "string_scanner" field. +func StringScannerHasSuffix(v schema.StringScanner) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStringScanner, p.EndingWith(vc)) + }) +} + +// StringScannerIsNil applies the IsNil predicate on the "string_scanner" field. +func StringScannerIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldStringScanner) + }) +} + +// StringScannerNotNil applies the NotNil predicate on the "string_scanner" field. +func StringScannerNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldStringScanner) + }) +} + +// DurationEQ applies the EQ predicate on the "duration" field. +func DurationEQ(v time.Duration) predicate.FieldType { + vc := int64(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDuration, p.EQ(vc)) + }) +} + +// DurationNEQ applies the NEQ predicate on the "duration" field. +func DurationNEQ(v time.Duration) predicate.FieldType { + vc := int64(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDuration, p.NEQ(vc)) + }) +} + +// DurationIn applies the In predicate on the "duration" field. +func DurationIn(vs ...time.Duration) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = int64(vs[i]) + } + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDuration, p.Within(v...)) + }) +} + +// DurationNotIn applies the NotIn predicate on the "duration" field. +func DurationNotIn(vs ...time.Duration) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = int64(vs[i]) + } + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDuration, p.Without(v...)) + }) +} + +// DurationGT applies the GT predicate on the "duration" field. +func DurationGT(v time.Duration) predicate.FieldType { + vc := int64(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDuration, p.GT(vc)) + }) +} + +// DurationGTE applies the GTE predicate on the "duration" field. +func DurationGTE(v time.Duration) predicate.FieldType { + vc := int64(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDuration, p.GTE(vc)) + }) +} + +// DurationLT applies the LT predicate on the "duration" field. +func DurationLT(v time.Duration) predicate.FieldType { + vc := int64(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDuration, p.LT(vc)) + }) +} + +// DurationLTE applies the LTE predicate on the "duration" field. +func DurationLTE(v time.Duration) predicate.FieldType { + vc := int64(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDuration, p.LTE(vc)) + }) +} + +// DurationIsNil applies the IsNil predicate on the "duration" field. +func DurationIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldDuration) + }) +} + +// DurationNotNil applies the NotNil predicate on the "duration" field. +func DurationNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldDuration) + }) +} + +// DirEQ applies the EQ predicate on the "dir" field. +func DirEQ(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDir, p.EQ(vc)) + }) +} + +// DirNEQ applies the NEQ predicate on the "dir" field. +func DirNEQ(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDir, p.NEQ(vc)) + }) +} + +// DirIn applies the In predicate on the "dir" field. +func DirIn(vs ...http.Dir) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = string(vs[i]) + } + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDir, p.Within(v...)) + }) +} + +// DirNotIn applies the NotIn predicate on the "dir" field. +func DirNotIn(vs ...http.Dir) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = string(vs[i]) + } + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDir, p.Without(v...)) + }) +} + +// DirGT applies the GT predicate on the "dir" field. +func DirGT(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDir, p.GT(vc)) + }) +} + +// DirGTE applies the GTE predicate on the "dir" field. +func DirGTE(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDir, p.GTE(vc)) + }) +} + +// DirLT applies the LT predicate on the "dir" field. +func DirLT(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDir, p.LT(vc)) + }) +} + +// DirLTE applies the LTE predicate on the "dir" field. +func DirLTE(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDir, p.LTE(vc)) + }) +} + +// DirContains applies the Contains predicate on the "dir" field. +func DirContains(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDir, p.Containing(vc)) + }) +} + +// DirHasPrefix applies the HasPrefix predicate on the "dir" field. +func DirHasPrefix(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDir, p.StartingWith(vc)) + }) +} + +// DirHasSuffix applies the HasSuffix predicate on the "dir" field. +func DirHasSuffix(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDir, p.EndingWith(vc)) + }) +} + +// NdirEQ applies the EQ predicate on the "ndir" field. +func NdirEQ(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNdir, p.EQ(vc)) + }) +} + +// NdirNEQ applies the NEQ predicate on the "ndir" field. +func NdirNEQ(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNdir, p.NEQ(vc)) + }) +} + +// NdirIn applies the In predicate on the "ndir" field. +func NdirIn(vs ...http.Dir) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = string(vs[i]) + } + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNdir, p.Within(v...)) + }) +} + +// NdirNotIn applies the NotIn predicate on the "ndir" field. +func NdirNotIn(vs ...http.Dir) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = string(vs[i]) + } + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNdir, p.Without(v...)) + }) +} + +// NdirGT applies the GT predicate on the "ndir" field. +func NdirGT(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNdir, p.GT(vc)) + }) +} + +// NdirGTE applies the GTE predicate on the "ndir" field. +func NdirGTE(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNdir, p.GTE(vc)) + }) +} + +// NdirLT applies the LT predicate on the "ndir" field. +func NdirLT(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNdir, p.LT(vc)) + }) +} + +// NdirLTE applies the LTE predicate on the "ndir" field. +func NdirLTE(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNdir, p.LTE(vc)) + }) +} + +// NdirContains applies the Contains predicate on the "ndir" field. +func NdirContains(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNdir, p.Containing(vc)) + }) +} + +// NdirHasPrefix applies the HasPrefix predicate on the "ndir" field. +func NdirHasPrefix(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNdir, p.StartingWith(vc)) + }) +} + +// NdirHasSuffix applies the HasSuffix predicate on the "ndir" field. +func NdirHasSuffix(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNdir, p.EndingWith(vc)) + }) +} + +// NdirIsNil applies the IsNil predicate on the "ndir" field. +func NdirIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldNdir) + }) +} + +// NdirNotNil applies the NotNil predicate on the "ndir" field. +func NdirNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldNdir) + }) +} + +// StrEQ applies the EQ predicate on the "str" field. +func StrEQ(v sql.NullString) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStr, p.EQ(v)) + }) +} + +// StrNEQ applies the NEQ predicate on the "str" field. +func StrNEQ(v sql.NullString) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStr, p.NEQ(v)) + }) +} + +// StrIn applies the In predicate on the "str" field. +func StrIn(vs ...sql.NullString) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStr, p.Within(vs...)) + }) +} + +// StrNotIn applies the NotIn predicate on the "str" field. +func StrNotIn(vs ...sql.NullString) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStr, p.Without(vs...)) + }) +} + +// StrGT applies the GT predicate on the "str" field. +func StrGT(v sql.NullString) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStr, p.GT(v)) + }) +} + +// StrGTE applies the GTE predicate on the "str" field. +func StrGTE(v sql.NullString) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStr, p.GTE(v)) + }) +} + +// StrLT applies the LT predicate on the "str" field. +func StrLT(v sql.NullString) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStr, p.LT(v)) + }) +} + +// StrLTE applies the LTE predicate on the "str" field. +func StrLTE(v sql.NullString) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStr, p.LTE(v)) + }) +} + +// StrContains applies the Contains predicate on the "str" field. +func StrContains(v sql.NullString) predicate.FieldType { + vc := v.String + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStr, p.Containing(vc)) + }) +} + +// StrHasPrefix applies the HasPrefix predicate on the "str" field. +func StrHasPrefix(v sql.NullString) predicate.FieldType { + vc := v.String + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStr, p.StartingWith(vc)) + }) +} + +// StrHasSuffix applies the HasSuffix predicate on the "str" field. +func StrHasSuffix(v sql.NullString) predicate.FieldType { + vc := v.String + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldStr, p.EndingWith(vc)) + }) +} + +// StrIsNil applies the IsNil predicate on the "str" field. +func StrIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldStr) + }) +} + +// StrNotNil applies the NotNil predicate on the "str" field. +func StrNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldStr) + }) +} + +// NullStrEQ applies the EQ predicate on the "null_str" field. +func NullStrEQ(v *sql.NullString) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullStr, p.EQ(v)) + }) +} + +// NullStrNEQ applies the NEQ predicate on the "null_str" field. +func NullStrNEQ(v *sql.NullString) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullStr, p.NEQ(v)) + }) +} + +// NullStrIn applies the In predicate on the "null_str" field. +func NullStrIn(vs ...*sql.NullString) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullStr, p.Within(vs...)) + }) +} + +// NullStrNotIn applies the NotIn predicate on the "null_str" field. +func NullStrNotIn(vs ...*sql.NullString) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullStr, p.Without(vs...)) + }) +} + +// NullStrGT applies the GT predicate on the "null_str" field. +func NullStrGT(v *sql.NullString) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullStr, p.GT(v)) + }) +} + +// NullStrGTE applies the GTE predicate on the "null_str" field. +func NullStrGTE(v *sql.NullString) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullStr, p.GTE(v)) + }) +} + +// NullStrLT applies the LT predicate on the "null_str" field. +func NullStrLT(v *sql.NullString) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullStr, p.LT(v)) + }) +} + +// NullStrLTE applies the LTE predicate on the "null_str" field. +func NullStrLTE(v *sql.NullString) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullStr, p.LTE(v)) + }) +} + +// NullStrContains applies the Contains predicate on the "null_str" field. +func NullStrContains(v *sql.NullString) predicate.FieldType { + vc := v.String + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullStr, p.Containing(vc)) + }) +} + +// NullStrHasPrefix applies the HasPrefix predicate on the "null_str" field. +func NullStrHasPrefix(v *sql.NullString) predicate.FieldType { + vc := v.String + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullStr, p.StartingWith(vc)) + }) +} + +// NullStrHasSuffix applies the HasSuffix predicate on the "null_str" field. +func NullStrHasSuffix(v *sql.NullString) predicate.FieldType { + vc := v.String + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullStr, p.EndingWith(vc)) + }) +} + +// NullStrIsNil applies the IsNil predicate on the "null_str" field. +func NullStrIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldNullStr) + }) +} + +// NullStrNotNil applies the NotNil predicate on the "null_str" field. +func NullStrNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldNullStr) + }) +} + +// LinkEQ applies the EQ predicate on the "link" field. +func LinkEQ(v schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLink, p.EQ(v)) + }) +} + +// LinkNEQ applies the NEQ predicate on the "link" field. +func LinkNEQ(v schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLink, p.NEQ(v)) + }) +} + +// LinkIn applies the In predicate on the "link" field. +func LinkIn(vs ...schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLink, p.Within(vs...)) + }) +} + +// LinkNotIn applies the NotIn predicate on the "link" field. +func LinkNotIn(vs ...schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLink, p.Without(vs...)) + }) +} + +// LinkGT applies the GT predicate on the "link" field. +func LinkGT(v schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLink, p.GT(v)) + }) +} + +// LinkGTE applies the GTE predicate on the "link" field. +func LinkGTE(v schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLink, p.GTE(v)) + }) +} + +// LinkLT applies the LT predicate on the "link" field. +func LinkLT(v schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLink, p.LT(v)) + }) +} + +// LinkLTE applies the LTE predicate on the "link" field. +func LinkLTE(v schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLink, p.LTE(v)) + }) +} + +// LinkContains applies the Contains predicate on the "link" field. +func LinkContains(v schema.Link) predicate.FieldType { + vc := v.String() + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLink, p.Containing(vc)) + }) +} + +// LinkHasPrefix applies the HasPrefix predicate on the "link" field. +func LinkHasPrefix(v schema.Link) predicate.FieldType { + vc := v.String() + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLink, p.StartingWith(vc)) + }) +} + +// LinkHasSuffix applies the HasSuffix predicate on the "link" field. +func LinkHasSuffix(v schema.Link) predicate.FieldType { + vc := v.String() + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldLink, p.EndingWith(vc)) + }) +} + +// LinkIsNil applies the IsNil predicate on the "link" field. +func LinkIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldLink) + }) +} + +// LinkNotNil applies the NotNil predicate on the "link" field. +func LinkNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldLink) + }) +} + +// NullLinkEQ applies the EQ predicate on the "null_link" field. +func NullLinkEQ(v *schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullLink, p.EQ(v)) + }) +} + +// NullLinkNEQ applies the NEQ predicate on the "null_link" field. +func NullLinkNEQ(v *schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullLink, p.NEQ(v)) + }) +} + +// NullLinkIn applies the In predicate on the "null_link" field. +func NullLinkIn(vs ...*schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullLink, p.Within(vs...)) + }) +} + +// NullLinkNotIn applies the NotIn predicate on the "null_link" field. +func NullLinkNotIn(vs ...*schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullLink, p.Without(vs...)) + }) +} + +// NullLinkGT applies the GT predicate on the "null_link" field. +func NullLinkGT(v *schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullLink, p.GT(v)) + }) +} + +// NullLinkGTE applies the GTE predicate on the "null_link" field. +func NullLinkGTE(v *schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullLink, p.GTE(v)) + }) +} + +// NullLinkLT applies the LT predicate on the "null_link" field. +func NullLinkLT(v *schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullLink, p.LT(v)) + }) +} + +// NullLinkLTE applies the LTE predicate on the "null_link" field. +func NullLinkLTE(v *schema.Link) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullLink, p.LTE(v)) + }) +} + +// NullLinkContains applies the Contains predicate on the "null_link" field. +func NullLinkContains(v *schema.Link) predicate.FieldType { + vc := v.String() + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullLink, p.Containing(vc)) + }) +} + +// NullLinkHasPrefix applies the HasPrefix predicate on the "null_link" field. +func NullLinkHasPrefix(v *schema.Link) predicate.FieldType { + vc := v.String() + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullLink, p.StartingWith(vc)) + }) +} + +// NullLinkHasSuffix applies the HasSuffix predicate on the "null_link" field. +func NullLinkHasSuffix(v *schema.Link) predicate.FieldType { + vc := v.String() + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullLink, p.EndingWith(vc)) + }) +} + +// NullLinkIsNil applies the IsNil predicate on the "null_link" field. +func NullLinkIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldNullLink) + }) +} + +// NullLinkNotNil applies the NotNil predicate on the "null_link" field. +func NullLinkNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldNullLink) + }) +} + +// ActiveEQ applies the EQ predicate on the "active" field. +func ActiveEQ(v schema.Status) predicate.FieldType { + vc := bool(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldActive, p.EQ(vc)) + }) +} + +// ActiveNEQ applies the NEQ predicate on the "active" field. +func ActiveNEQ(v schema.Status) predicate.FieldType { + vc := bool(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldActive, p.NEQ(vc)) + }) +} + +// ActiveIsNil applies the IsNil predicate on the "active" field. +func ActiveIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldActive) + }) +} + +// ActiveNotNil applies the NotNil predicate on the "active" field. +func ActiveNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldActive) + }) +} + +// NullActiveEQ applies the EQ predicate on the "null_active" field. +func NullActiveEQ(v schema.Status) predicate.FieldType { + vc := bool(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullActive, p.EQ(vc)) + }) +} + +// NullActiveNEQ applies the NEQ predicate on the "null_active" field. +func NullActiveNEQ(v schema.Status) predicate.FieldType { + vc := bool(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullActive, p.NEQ(vc)) + }) +} + +// NullActiveIsNil applies the IsNil predicate on the "null_active" field. +func NullActiveIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldNullActive) + }) +} + +// NullActiveNotNil applies the NotNil predicate on the "null_active" field. +func NullActiveNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldNullActive) + }) +} + +// DeletedEQ applies the EQ predicate on the "deleted" field. +func DeletedEQ(v *sql.NullBool) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDeleted, p.EQ(v)) + }) +} + +// DeletedNEQ applies the NEQ predicate on the "deleted" field. +func DeletedNEQ(v *sql.NullBool) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDeleted, p.NEQ(v)) + }) +} + +// DeletedIsNil applies the IsNil predicate on the "deleted" field. +func DeletedIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldDeleted) + }) +} + +// DeletedNotNil applies the NotNil predicate on the "deleted" field. +func DeletedNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldDeleted) + }) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v *sql.NullTime) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDeletedAt, p.EQ(v)) + }) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v *sql.NullTime) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDeletedAt, p.NEQ(v)) + }) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...*sql.NullTime) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDeletedAt, p.Within(vs...)) + }) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...*sql.NullTime) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDeletedAt, p.Without(vs...)) + }) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v *sql.NullTime) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDeletedAt, p.GT(v)) + }) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v *sql.NullTime) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDeletedAt, p.GTE(v)) + }) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v *sql.NullTime) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDeletedAt, p.LT(v)) + }) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v *sql.NullTime) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDeletedAt, p.LTE(v)) + }) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldDeletedAt) + }) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldDeletedAt) + }) +} + +// RawDataEQ applies the EQ predicate on the "raw_data" field. +func RawDataEQ(v []byte) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldRawData, p.EQ(v)) + }) +} + +// RawDataNEQ applies the NEQ predicate on the "raw_data" field. +func RawDataNEQ(v []byte) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldRawData, p.NEQ(v)) + }) +} + +// RawDataIn applies the In predicate on the "raw_data" field. +func RawDataIn(vs ...[]byte) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldRawData, p.Within(vs...)) + }) +} + +// RawDataNotIn applies the NotIn predicate on the "raw_data" field. +func RawDataNotIn(vs ...[]byte) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldRawData, p.Without(vs...)) + }) +} + +// RawDataGT applies the GT predicate on the "raw_data" field. +func RawDataGT(v []byte) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldRawData, p.GT(v)) + }) +} + +// RawDataGTE applies the GTE predicate on the "raw_data" field. +func RawDataGTE(v []byte) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldRawData, p.GTE(v)) + }) +} + +// RawDataLT applies the LT predicate on the "raw_data" field. +func RawDataLT(v []byte) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldRawData, p.LT(v)) + }) +} + +// RawDataLTE applies the LTE predicate on the "raw_data" field. +func RawDataLTE(v []byte) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldRawData, p.LTE(v)) + }) +} + +// RawDataIsNil applies the IsNil predicate on the "raw_data" field. +func RawDataIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldRawData) + }) +} + +// RawDataNotNil applies the NotNil predicate on the "raw_data" field. +func RawDataNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldRawData) + }) +} + +// SensitiveEQ applies the EQ predicate on the "sensitive" field. +func SensitiveEQ(v []byte) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSensitive, p.EQ(v)) + }) +} + +// SensitiveNEQ applies the NEQ predicate on the "sensitive" field. +func SensitiveNEQ(v []byte) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSensitive, p.NEQ(v)) + }) +} + +// SensitiveIn applies the In predicate on the "sensitive" field. +func SensitiveIn(vs ...[]byte) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSensitive, p.Within(vs...)) + }) +} + +// SensitiveNotIn applies the NotIn predicate on the "sensitive" field. +func SensitiveNotIn(vs ...[]byte) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSensitive, p.Without(vs...)) + }) +} + +// SensitiveGT applies the GT predicate on the "sensitive" field. +func SensitiveGT(v []byte) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSensitive, p.GT(v)) + }) +} + +// SensitiveGTE applies the GTE predicate on the "sensitive" field. +func SensitiveGTE(v []byte) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSensitive, p.GTE(v)) + }) +} + +// SensitiveLT applies the LT predicate on the "sensitive" field. +func SensitiveLT(v []byte) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSensitive, p.LT(v)) + }) +} + +// SensitiveLTE applies the LTE predicate on the "sensitive" field. +func SensitiveLTE(v []byte) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSensitive, p.LTE(v)) + }) +} + +// SensitiveIsNil applies the IsNil predicate on the "sensitive" field. +func SensitiveIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldSensitive) + }) +} + +// SensitiveNotNil applies the NotNil predicate on the "sensitive" field. +func SensitiveNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldSensitive) + }) +} + +// IPEQ applies the EQ predicate on the "ip" field. +func IPEQ(v net.IP) predicate.FieldType { + vc := []byte(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldIP, p.EQ(vc)) + }) +} + +// IPNEQ applies the NEQ predicate on the "ip" field. +func IPNEQ(v net.IP) predicate.FieldType { + vc := []byte(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldIP, p.NEQ(vc)) + }) +} + +// IPIn applies the In predicate on the "ip" field. +func IPIn(vs ...net.IP) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = []byte(vs[i]) + } + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldIP, p.Within(v...)) + }) +} + +// IPNotIn applies the NotIn predicate on the "ip" field. +func IPNotIn(vs ...net.IP) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = []byte(vs[i]) + } + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldIP, p.Without(v...)) + }) +} + +// IPGT applies the GT predicate on the "ip" field. +func IPGT(v net.IP) predicate.FieldType { + vc := []byte(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldIP, p.GT(vc)) + }) +} + +// IPGTE applies the GTE predicate on the "ip" field. +func IPGTE(v net.IP) predicate.FieldType { + vc := []byte(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldIP, p.GTE(vc)) + }) +} + +// IPLT applies the LT predicate on the "ip" field. +func IPLT(v net.IP) predicate.FieldType { + vc := []byte(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldIP, p.LT(vc)) + }) +} + +// IPLTE applies the LTE predicate on the "ip" field. +func IPLTE(v net.IP) predicate.FieldType { + vc := []byte(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldIP, p.LTE(vc)) + }) +} + +// IPIsNil applies the IsNil predicate on the "ip" field. +func IPIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldIP) + }) +} + +// IPNotNil applies the NotNil predicate on the "ip" field. +func IPNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldIP) + }) +} + +// NullInt64EQ applies the EQ predicate on the "null_int64" field. +func NullInt64EQ(v *sql.NullInt64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullInt64, p.EQ(v)) + }) +} + +// NullInt64NEQ applies the NEQ predicate on the "null_int64" field. +func NullInt64NEQ(v *sql.NullInt64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullInt64, p.NEQ(v)) + }) +} + +// NullInt64In applies the In predicate on the "null_int64" field. +func NullInt64In(vs ...*sql.NullInt64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullInt64, p.Within(vs...)) + }) +} + +// NullInt64NotIn applies the NotIn predicate on the "null_int64" field. +func NullInt64NotIn(vs ...*sql.NullInt64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullInt64, p.Without(vs...)) + }) +} + +// NullInt64GT applies the GT predicate on the "null_int64" field. +func NullInt64GT(v *sql.NullInt64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullInt64, p.GT(v)) + }) +} + +// NullInt64GTE applies the GTE predicate on the "null_int64" field. +func NullInt64GTE(v *sql.NullInt64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullInt64, p.GTE(v)) + }) +} + +// NullInt64LT applies the LT predicate on the "null_int64" field. +func NullInt64LT(v *sql.NullInt64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullInt64, p.LT(v)) + }) +} + +// NullInt64LTE applies the LTE predicate on the "null_int64" field. +func NullInt64LTE(v *sql.NullInt64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullInt64, p.LTE(v)) + }) +} + +// NullInt64IsNil applies the IsNil predicate on the "null_int64" field. +func NullInt64IsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldNullInt64) + }) +} + +// NullInt64NotNil applies the NotNil predicate on the "null_int64" field. +func NullInt64NotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldNullInt64) + }) +} + +// SchemaIntEQ applies the EQ predicate on the "schema_int" field. +func SchemaIntEQ(v schema.Int) predicate.FieldType { + vc := int(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaInt, p.EQ(vc)) + }) +} + +// SchemaIntNEQ applies the NEQ predicate on the "schema_int" field. +func SchemaIntNEQ(v schema.Int) predicate.FieldType { + vc := int(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaInt, p.NEQ(vc)) + }) +} + +// SchemaIntIn applies the In predicate on the "schema_int" field. +func SchemaIntIn(vs ...schema.Int) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = int(vs[i]) + } + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaInt, p.Within(v...)) + }) +} + +// SchemaIntNotIn applies the NotIn predicate on the "schema_int" field. +func SchemaIntNotIn(vs ...schema.Int) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = int(vs[i]) + } + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaInt, p.Without(v...)) + }) +} + +// SchemaIntGT applies the GT predicate on the "schema_int" field. +func SchemaIntGT(v schema.Int) predicate.FieldType { + vc := int(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaInt, p.GT(vc)) + }) +} + +// SchemaIntGTE applies the GTE predicate on the "schema_int" field. +func SchemaIntGTE(v schema.Int) predicate.FieldType { + vc := int(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaInt, p.GTE(vc)) + }) +} + +// SchemaIntLT applies the LT predicate on the "schema_int" field. +func SchemaIntLT(v schema.Int) predicate.FieldType { + vc := int(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaInt, p.LT(vc)) + }) +} + +// SchemaIntLTE applies the LTE predicate on the "schema_int" field. +func SchemaIntLTE(v schema.Int) predicate.FieldType { + vc := int(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaInt, p.LTE(vc)) + }) +} + +// SchemaIntIsNil applies the IsNil predicate on the "schema_int" field. +func SchemaIntIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldSchemaInt) + }) +} + +// SchemaIntNotNil applies the NotNil predicate on the "schema_int" field. +func SchemaIntNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldSchemaInt) + }) +} + +// SchemaInt8EQ applies the EQ predicate on the "schema_int8" field. +func SchemaInt8EQ(v schema.Int8) predicate.FieldType { + vc := int8(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaInt8, p.EQ(vc)) + }) +} + +// SchemaInt8NEQ applies the NEQ predicate on the "schema_int8" field. +func SchemaInt8NEQ(v schema.Int8) predicate.FieldType { + vc := int8(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaInt8, p.NEQ(vc)) + }) +} + +// SchemaInt8In applies the In predicate on the "schema_int8" field. +func SchemaInt8In(vs ...schema.Int8) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = int8(vs[i]) + } + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaInt8, p.Within(v...)) + }) +} + +// SchemaInt8NotIn applies the NotIn predicate on the "schema_int8" field. +func SchemaInt8NotIn(vs ...schema.Int8) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = int8(vs[i]) + } + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaInt8, p.Without(v...)) + }) +} + +// SchemaInt8GT applies the GT predicate on the "schema_int8" field. +func SchemaInt8GT(v schema.Int8) predicate.FieldType { + vc := int8(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaInt8, p.GT(vc)) + }) +} + +// SchemaInt8GTE applies the GTE predicate on the "schema_int8" field. +func SchemaInt8GTE(v schema.Int8) predicate.FieldType { + vc := int8(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaInt8, p.GTE(vc)) + }) +} + +// SchemaInt8LT applies the LT predicate on the "schema_int8" field. +func SchemaInt8LT(v schema.Int8) predicate.FieldType { + vc := int8(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaInt8, p.LT(vc)) + }) +} + +// SchemaInt8LTE applies the LTE predicate on the "schema_int8" field. +func SchemaInt8LTE(v schema.Int8) predicate.FieldType { + vc := int8(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaInt8, p.LTE(vc)) + }) +} + +// SchemaInt8IsNil applies the IsNil predicate on the "schema_int8" field. +func SchemaInt8IsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldSchemaInt8) + }) +} + +// SchemaInt8NotNil applies the NotNil predicate on the "schema_int8" field. +func SchemaInt8NotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldSchemaInt8) + }) +} + +// SchemaInt64EQ applies the EQ predicate on the "schema_int64" field. +func SchemaInt64EQ(v schema.Int64) predicate.FieldType { + vc := int64(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaInt64, p.EQ(vc)) + }) +} + +// SchemaInt64NEQ applies the NEQ predicate on the "schema_int64" field. +func SchemaInt64NEQ(v schema.Int64) predicate.FieldType { + vc := int64(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaInt64, p.NEQ(vc)) + }) +} + +// SchemaInt64In applies the In predicate on the "schema_int64" field. +func SchemaInt64In(vs ...schema.Int64) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = int64(vs[i]) + } + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaInt64, p.Within(v...)) + }) +} + +// SchemaInt64NotIn applies the NotIn predicate on the "schema_int64" field. +func SchemaInt64NotIn(vs ...schema.Int64) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = int64(vs[i]) + } + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaInt64, p.Without(v...)) + }) +} + +// SchemaInt64GT applies the GT predicate on the "schema_int64" field. +func SchemaInt64GT(v schema.Int64) predicate.FieldType { + vc := int64(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaInt64, p.GT(vc)) + }) +} + +// SchemaInt64GTE applies the GTE predicate on the "schema_int64" field. +func SchemaInt64GTE(v schema.Int64) predicate.FieldType { + vc := int64(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaInt64, p.GTE(vc)) + }) +} + +// SchemaInt64LT applies the LT predicate on the "schema_int64" field. +func SchemaInt64LT(v schema.Int64) predicate.FieldType { + vc := int64(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaInt64, p.LT(vc)) + }) +} + +// SchemaInt64LTE applies the LTE predicate on the "schema_int64" field. +func SchemaInt64LTE(v schema.Int64) predicate.FieldType { + vc := int64(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaInt64, p.LTE(vc)) + }) +} + +// SchemaInt64IsNil applies the IsNil predicate on the "schema_int64" field. +func SchemaInt64IsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldSchemaInt64) + }) +} + +// SchemaInt64NotNil applies the NotNil predicate on the "schema_int64" field. +func SchemaInt64NotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldSchemaInt64) + }) +} + +// SchemaFloatEQ applies the EQ predicate on the "schema_float" field. +func SchemaFloatEQ(v schema.Float64) predicate.FieldType { + vc := float64(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaFloat, p.EQ(vc)) + }) +} + +// SchemaFloatNEQ applies the NEQ predicate on the "schema_float" field. +func SchemaFloatNEQ(v schema.Float64) predicate.FieldType { + vc := float64(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaFloat, p.NEQ(vc)) + }) +} + +// SchemaFloatIn applies the In predicate on the "schema_float" field. +func SchemaFloatIn(vs ...schema.Float64) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = float64(vs[i]) + } + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaFloat, p.Within(v...)) + }) +} + +// SchemaFloatNotIn applies the NotIn predicate on the "schema_float" field. +func SchemaFloatNotIn(vs ...schema.Float64) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = float64(vs[i]) + } + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaFloat, p.Without(v...)) + }) +} + +// SchemaFloatGT applies the GT predicate on the "schema_float" field. +func SchemaFloatGT(v schema.Float64) predicate.FieldType { + vc := float64(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaFloat, p.GT(vc)) + }) +} + +// SchemaFloatGTE applies the GTE predicate on the "schema_float" field. +func SchemaFloatGTE(v schema.Float64) predicate.FieldType { + vc := float64(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaFloat, p.GTE(vc)) + }) +} + +// SchemaFloatLT applies the LT predicate on the "schema_float" field. +func SchemaFloatLT(v schema.Float64) predicate.FieldType { + vc := float64(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaFloat, p.LT(vc)) + }) +} + +// SchemaFloatLTE applies the LTE predicate on the "schema_float" field. +func SchemaFloatLTE(v schema.Float64) predicate.FieldType { + vc := float64(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaFloat, p.LTE(vc)) + }) +} + +// SchemaFloatIsNil applies the IsNil predicate on the "schema_float" field. +func SchemaFloatIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldSchemaFloat) + }) +} + +// SchemaFloatNotNil applies the NotNil predicate on the "schema_float" field. +func SchemaFloatNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldSchemaFloat) + }) +} + +// SchemaFloat32EQ applies the EQ predicate on the "schema_float32" field. +func SchemaFloat32EQ(v schema.Float32) predicate.FieldType { + vc := float32(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaFloat32, p.EQ(vc)) + }) +} + +// SchemaFloat32NEQ applies the NEQ predicate on the "schema_float32" field. +func SchemaFloat32NEQ(v schema.Float32) predicate.FieldType { + vc := float32(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaFloat32, p.NEQ(vc)) + }) +} + +// SchemaFloat32In applies the In predicate on the "schema_float32" field. +func SchemaFloat32In(vs ...schema.Float32) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = float32(vs[i]) + } + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaFloat32, p.Within(v...)) + }) +} + +// SchemaFloat32NotIn applies the NotIn predicate on the "schema_float32" field. +func SchemaFloat32NotIn(vs ...schema.Float32) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = float32(vs[i]) + } + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaFloat32, p.Without(v...)) + }) +} + +// SchemaFloat32GT applies the GT predicate on the "schema_float32" field. +func SchemaFloat32GT(v schema.Float32) predicate.FieldType { + vc := float32(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaFloat32, p.GT(vc)) + }) +} + +// SchemaFloat32GTE applies the GTE predicate on the "schema_float32" field. +func SchemaFloat32GTE(v schema.Float32) predicate.FieldType { + vc := float32(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaFloat32, p.GTE(vc)) + }) +} + +// SchemaFloat32LT applies the LT predicate on the "schema_float32" field. +func SchemaFloat32LT(v schema.Float32) predicate.FieldType { + vc := float32(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaFloat32, p.LT(vc)) + }) +} + +// SchemaFloat32LTE applies the LTE predicate on the "schema_float32" field. +func SchemaFloat32LTE(v schema.Float32) predicate.FieldType { + vc := float32(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldSchemaFloat32, p.LTE(vc)) + }) +} + +// SchemaFloat32IsNil applies the IsNil predicate on the "schema_float32" field. +func SchemaFloat32IsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldSchemaFloat32) + }) +} + +// SchemaFloat32NotNil applies the NotNil predicate on the "schema_float32" field. +func SchemaFloat32NotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldSchemaFloat32) + }) +} + +// NullFloatEQ applies the EQ predicate on the "null_float" field. +func NullFloatEQ(v *sql.NullFloat64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullFloat, p.EQ(v)) + }) +} + +// NullFloatNEQ applies the NEQ predicate on the "null_float" field. +func NullFloatNEQ(v *sql.NullFloat64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullFloat, p.NEQ(v)) + }) +} + +// NullFloatIn applies the In predicate on the "null_float" field. +func NullFloatIn(vs ...*sql.NullFloat64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullFloat, p.Within(vs...)) + }) +} + +// NullFloatNotIn applies the NotIn predicate on the "null_float" field. +func NullFloatNotIn(vs ...*sql.NullFloat64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullFloat, p.Without(vs...)) + }) +} + +// NullFloatGT applies the GT predicate on the "null_float" field. +func NullFloatGT(v *sql.NullFloat64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullFloat, p.GT(v)) + }) +} + +// NullFloatGTE applies the GTE predicate on the "null_float" field. +func NullFloatGTE(v *sql.NullFloat64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullFloat, p.GTE(v)) + }) +} + +// NullFloatLT applies the LT predicate on the "null_float" field. +func NullFloatLT(v *sql.NullFloat64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullFloat, p.LT(v)) + }) +} + +// NullFloatLTE applies the LTE predicate on the "null_float" field. +func NullFloatLTE(v *sql.NullFloat64) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNullFloat, p.LTE(v)) + }) +} + +// NullFloatIsNil applies the IsNil predicate on the "null_float" field. +func NullFloatIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldNullFloat) + }) +} + +// NullFloatNotNil applies the NotNil predicate on the "null_float" field. +func NullFloatNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldNullFloat) + }) +} + +// RoleEQ applies the EQ predicate on the "role" field. +func RoleEQ(v role.Role) predicate.FieldType { + vc := v + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldRole, p.EQ(vc)) + }) +} + +// RoleNEQ applies the NEQ predicate on the "role" field. +func RoleNEQ(v role.Role) predicate.FieldType { + vc := v + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldRole, p.NEQ(vc)) + }) +} + +// RoleIn applies the In predicate on the "role" field. +func RoleIn(vs ...role.Role) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldRole, p.Within(v...)) + }) +} + +// RoleNotIn applies the NotIn predicate on the "role" field. +func RoleNotIn(vs ...role.Role) predicate.FieldType { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldRole, p.Without(v...)) + }) +} + +// PriorityEQ applies the EQ predicate on the "priority" field. +func PriorityEQ(v role.Priority) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPriority, p.EQ(v)) + }) +} + +// PriorityNEQ applies the NEQ predicate on the "priority" field. +func PriorityNEQ(v role.Priority) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPriority, p.NEQ(v)) + }) +} + +// PriorityIn applies the In predicate on the "priority" field. +func PriorityIn(vs ...role.Priority) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPriority, p.Within(vs...)) + }) +} + +// PriorityNotIn applies the NotIn predicate on the "priority" field. +func PriorityNotIn(vs ...role.Priority) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPriority, p.Without(vs...)) + }) +} + +// PriorityIsNil applies the IsNil predicate on the "priority" field. +func PriorityIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldPriority) + }) +} + +// PriorityNotNil applies the NotNil predicate on the "priority" field. +func PriorityNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldPriority) + }) +} + +// OptionalUUIDEQ applies the EQ predicate on the "optional_uuid" field. +func OptionalUUIDEQ(v uuid.UUID) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUUID, p.EQ(v)) + }) +} + +// OptionalUUIDNEQ applies the NEQ predicate on the "optional_uuid" field. +func OptionalUUIDNEQ(v uuid.UUID) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUUID, p.NEQ(v)) + }) +} + +// OptionalUUIDIn applies the In predicate on the "optional_uuid" field. +func OptionalUUIDIn(vs ...uuid.UUID) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUUID, p.Within(vs...)) + }) +} + +// OptionalUUIDNotIn applies the NotIn predicate on the "optional_uuid" field. +func OptionalUUIDNotIn(vs ...uuid.UUID) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUUID, p.Without(vs...)) + }) +} + +// OptionalUUIDGT applies the GT predicate on the "optional_uuid" field. +func OptionalUUIDGT(v uuid.UUID) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUUID, p.GT(v)) + }) +} + +// OptionalUUIDGTE applies the GTE predicate on the "optional_uuid" field. +func OptionalUUIDGTE(v uuid.UUID) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUUID, p.GTE(v)) + }) +} + +// OptionalUUIDLT applies the LT predicate on the "optional_uuid" field. +func OptionalUUIDLT(v uuid.UUID) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUUID, p.LT(v)) + }) +} + +// OptionalUUIDLTE applies the LTE predicate on the "optional_uuid" field. +func OptionalUUIDLTE(v uuid.UUID) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldOptionalUUID, p.LTE(v)) + }) +} + +// OptionalUUIDIsNil applies the IsNil predicate on the "optional_uuid" field. +func OptionalUUIDIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldOptionalUUID) + }) +} + +// OptionalUUIDNotNil applies the NotNil predicate on the "optional_uuid" field. +func OptionalUUIDNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldOptionalUUID) + }) +} + +// NillableUUIDEQ applies the EQ predicate on the "nillable_uuid" field. +func NillableUUIDEQ(v uuid.UUID) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableUUID, p.EQ(v)) + }) +} + +// NillableUUIDNEQ applies the NEQ predicate on the "nillable_uuid" field. +func NillableUUIDNEQ(v uuid.UUID) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableUUID, p.NEQ(v)) + }) +} + +// NillableUUIDIn applies the In predicate on the "nillable_uuid" field. +func NillableUUIDIn(vs ...uuid.UUID) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableUUID, p.Within(vs...)) + }) +} + +// NillableUUIDNotIn applies the NotIn predicate on the "nillable_uuid" field. +func NillableUUIDNotIn(vs ...uuid.UUID) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableUUID, p.Without(vs...)) + }) +} + +// NillableUUIDGT applies the GT predicate on the "nillable_uuid" field. +func NillableUUIDGT(v uuid.UUID) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableUUID, p.GT(v)) + }) +} + +// NillableUUIDGTE applies the GTE predicate on the "nillable_uuid" field. +func NillableUUIDGTE(v uuid.UUID) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableUUID, p.GTE(v)) + }) +} + +// NillableUUIDLT applies the LT predicate on the "nillable_uuid" field. +func NillableUUIDLT(v uuid.UUID) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableUUID, p.LT(v)) + }) +} + +// NillableUUIDLTE applies the LTE predicate on the "nillable_uuid" field. +func NillableUUIDLTE(v uuid.UUID) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNillableUUID, p.LTE(v)) + }) +} + +// NillableUUIDIsNil applies the IsNil predicate on the "nillable_uuid" field. +func NillableUUIDIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldNillableUUID) + }) +} + +// NillableUUIDNotNil applies the NotNil predicate on the "nillable_uuid" field. +func NillableUUIDNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldNillableUUID) + }) +} + +// StringsIsNil applies the IsNil predicate on the "strings" field. +func StringsIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldStrings) + }) +} + +// StringsNotNil applies the NotNil predicate on the "strings" field. +func StringsNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldStrings) + }) +} + +// PairEQ applies the EQ predicate on the "pair" field. +func PairEQ(v schema.Pair) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPair, p.EQ(v)) + }) +} + +// PairNEQ applies the NEQ predicate on the "pair" field. +func PairNEQ(v schema.Pair) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPair, p.NEQ(v)) + }) +} + +// PairIn applies the In predicate on the "pair" field. +func PairIn(vs ...schema.Pair) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPair, p.Within(vs...)) + }) +} + +// PairNotIn applies the NotIn predicate on the "pair" field. +func PairNotIn(vs ...schema.Pair) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPair, p.Without(vs...)) + }) +} + +// PairGT applies the GT predicate on the "pair" field. +func PairGT(v schema.Pair) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPair, p.GT(v)) + }) +} + +// PairGTE applies the GTE predicate on the "pair" field. +func PairGTE(v schema.Pair) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPair, p.GTE(v)) + }) +} + +// PairLT applies the LT predicate on the "pair" field. +func PairLT(v schema.Pair) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPair, p.LT(v)) + }) +} + +// PairLTE applies the LTE predicate on the "pair" field. +func PairLTE(v schema.Pair) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPair, p.LTE(v)) + }) +} + +// NilPairEQ applies the EQ predicate on the "nil_pair" field. +func NilPairEQ(v *schema.Pair) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNilPair, p.EQ(v)) + }) +} + +// NilPairNEQ applies the NEQ predicate on the "nil_pair" field. +func NilPairNEQ(v *schema.Pair) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNilPair, p.NEQ(v)) + }) +} + +// NilPairIn applies the In predicate on the "nil_pair" field. +func NilPairIn(vs ...*schema.Pair) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNilPair, p.Within(vs...)) + }) +} + +// NilPairNotIn applies the NotIn predicate on the "nil_pair" field. +func NilPairNotIn(vs ...*schema.Pair) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNilPair, p.Without(vs...)) + }) +} + +// NilPairGT applies the GT predicate on the "nil_pair" field. +func NilPairGT(v *schema.Pair) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNilPair, p.GT(v)) + }) +} + +// NilPairGTE applies the GTE predicate on the "nil_pair" field. +func NilPairGTE(v *schema.Pair) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNilPair, p.GTE(v)) + }) +} + +// NilPairLT applies the LT predicate on the "nil_pair" field. +func NilPairLT(v *schema.Pair) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNilPair, p.LT(v)) + }) +} + +// NilPairLTE applies the LTE predicate on the "nil_pair" field. +func NilPairLTE(v *schema.Pair) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldNilPair, p.LTE(v)) + }) +} + +// NilPairIsNil applies the IsNil predicate on the "nil_pair" field. +func NilPairIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldNilPair) + }) +} + +// NilPairNotNil applies the NotNil predicate on the "nil_pair" field. +func NilPairNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldNilPair) + }) +} + +// VstringEQ applies the EQ predicate on the "vstring" field. +func VstringEQ(v schema.VString) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldVstring, p.EQ(v)) + }) +} + +// VstringNEQ applies the NEQ predicate on the "vstring" field. +func VstringNEQ(v schema.VString) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldVstring, p.NEQ(v)) + }) +} + +// VstringIn applies the In predicate on the "vstring" field. +func VstringIn(vs ...schema.VString) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldVstring, p.Within(vs...)) + }) +} + +// VstringNotIn applies the NotIn predicate on the "vstring" field. +func VstringNotIn(vs ...schema.VString) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldVstring, p.Without(vs...)) + }) +} + +// VstringGT applies the GT predicate on the "vstring" field. +func VstringGT(v schema.VString) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldVstring, p.GT(v)) + }) +} + +// VstringGTE applies the GTE predicate on the "vstring" field. +func VstringGTE(v schema.VString) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldVstring, p.GTE(v)) + }) +} + +// VstringLT applies the LT predicate on the "vstring" field. +func VstringLT(v schema.VString) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldVstring, p.LT(v)) + }) +} + +// VstringLTE applies the LTE predicate on the "vstring" field. +func VstringLTE(v schema.VString) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldVstring, p.LTE(v)) + }) +} + +// VstringContains applies the Contains predicate on the "vstring" field. +func VstringContains(v schema.VString) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldVstring, p.Containing(vc)) + }) +} + +// VstringHasPrefix applies the HasPrefix predicate on the "vstring" field. +func VstringHasPrefix(v schema.VString) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldVstring, p.StartingWith(vc)) + }) +} + +// VstringHasSuffix applies the HasSuffix predicate on the "vstring" field. +func VstringHasSuffix(v schema.VString) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldVstring, p.EndingWith(vc)) + }) +} + +// TripleEQ applies the EQ predicate on the "triple" field. +func TripleEQ(v schema.Triple) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldTriple, p.EQ(v)) + }) +} + +// TripleNEQ applies the NEQ predicate on the "triple" field. +func TripleNEQ(v schema.Triple) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldTriple, p.NEQ(v)) + }) +} + +// TripleIn applies the In predicate on the "triple" field. +func TripleIn(vs ...schema.Triple) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldTriple, p.Within(vs...)) + }) +} + +// TripleNotIn applies the NotIn predicate on the "triple" field. +func TripleNotIn(vs ...schema.Triple) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldTriple, p.Without(vs...)) + }) +} + +// TripleGT applies the GT predicate on the "triple" field. +func TripleGT(v schema.Triple) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldTriple, p.GT(v)) + }) +} + +// TripleGTE applies the GTE predicate on the "triple" field. +func TripleGTE(v schema.Triple) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldTriple, p.GTE(v)) + }) +} + +// TripleLT applies the LT predicate on the "triple" field. +func TripleLT(v schema.Triple) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldTriple, p.LT(v)) + }) +} + +// TripleLTE applies the LTE predicate on the "triple" field. +func TripleLTE(v schema.Triple) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldTriple, p.LTE(v)) + }) +} + +// BigIntEQ applies the EQ predicate on the "big_int" field. +func BigIntEQ(v schema.BigInt) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldBigInt, p.EQ(v)) + }) +} + +// BigIntNEQ applies the NEQ predicate on the "big_int" field. +func BigIntNEQ(v schema.BigInt) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldBigInt, p.NEQ(v)) + }) +} + +// BigIntIn applies the In predicate on the "big_int" field. +func BigIntIn(vs ...schema.BigInt) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldBigInt, p.Within(vs...)) + }) +} + +// BigIntNotIn applies the NotIn predicate on the "big_int" field. +func BigIntNotIn(vs ...schema.BigInt) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldBigInt, p.Without(vs...)) + }) +} + +// BigIntGT applies the GT predicate on the "big_int" field. +func BigIntGT(v schema.BigInt) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldBigInt, p.GT(v)) + }) +} + +// BigIntGTE applies the GTE predicate on the "big_int" field. +func BigIntGTE(v schema.BigInt) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldBigInt, p.GTE(v)) + }) +} + +// BigIntLT applies the LT predicate on the "big_int" field. +func BigIntLT(v schema.BigInt) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldBigInt, p.LT(v)) + }) +} + +// BigIntLTE applies the LTE predicate on the "big_int" field. +func BigIntLTE(v schema.BigInt) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldBigInt, p.LTE(v)) + }) +} + +// BigIntIsNil applies the IsNil predicate on the "big_int" field. +func BigIntIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldBigInt) + }) +} + +// BigIntNotNil applies the NotNil predicate on the "big_int" field. +func BigIntNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldBigInt) + }) +} + +// PasswordOtherEQ applies the EQ predicate on the "password_other" field. +func PasswordOtherEQ(v schema.Password) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPasswordOther, p.EQ(v)) + }) +} + +// PasswordOtherNEQ applies the NEQ predicate on the "password_other" field. +func PasswordOtherNEQ(v schema.Password) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPasswordOther, p.NEQ(v)) + }) +} + +// PasswordOtherIn applies the In predicate on the "password_other" field. +func PasswordOtherIn(vs ...schema.Password) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPasswordOther, p.Within(vs...)) + }) +} + +// PasswordOtherNotIn applies the NotIn predicate on the "password_other" field. +func PasswordOtherNotIn(vs ...schema.Password) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPasswordOther, p.Without(vs...)) + }) +} + +// PasswordOtherGT applies the GT predicate on the "password_other" field. +func PasswordOtherGT(v schema.Password) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPasswordOther, p.GT(v)) + }) +} + +// PasswordOtherGTE applies the GTE predicate on the "password_other" field. +func PasswordOtherGTE(v schema.Password) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPasswordOther, p.GTE(v)) + }) +} + +// PasswordOtherLT applies the LT predicate on the "password_other" field. +func PasswordOtherLT(v schema.Password) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPasswordOther, p.LT(v)) + }) +} + +// PasswordOtherLTE applies the LTE predicate on the "password_other" field. +func PasswordOtherLTE(v schema.Password) predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldPasswordOther, p.LTE(v)) + }) +} + +// PasswordOtherIsNil applies the IsNil predicate on the "password_other" field. +func PasswordOtherIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldPasswordOther) + }) +} + +// PasswordOtherNotNil applies the NotNil predicate on the "password_other" field. +func PasswordOtherNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldPasswordOther) + }) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.FieldType) predicate.FieldType { + return predicate.FieldType(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.FieldType) predicate.FieldType { + return predicate.FieldType(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.FieldType) predicate.FieldType { + return predicate.FieldType(func(tr *dsl.Traversal) { + t := __.New() + p(t) + tr.Where(__.Not(t)) + }) +} diff --git a/entc/integration/gremlin/ent/mutation.go b/entc/integration/gremlin/ent/mutation.go new file mode 100644 index 0000000..9c04767 --- /dev/null +++ b/entc/integration/gremlin/ent/mutation.go @@ -0,0 +1,4982 @@ +// 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 ent + +import ( + "context" + "database/sql" + "errors" + "fmt" + "math/big" + "net" + "net/http" + "net/url" + "sync" + "time" + + "entgo.io/ent" + "entgo.io/ent/entc/integration/ent/role" + "entgo.io/ent/entc/integration/ent/schema" + schemadir "entgo.io/ent/entc/integration/ent/schema/dir" + "entgo.io/ent/entc/integration/ent/schema/task" + "entgo.io/ent/entc/integration/gremlin/ent/api" + "entgo.io/ent/entc/integration/gremlin/ent/builder" + "entgo.io/ent/entc/integration/gremlin/ent/card" + "entgo.io/ent/entc/integration/gremlin/ent/comment" + "entgo.io/ent/entc/integration/gremlin/ent/document" + "entgo.io/ent/entc/integration/gremlin/ent/exvaluescan" + "entgo.io/ent/entc/integration/gremlin/ent/fieldtype" + "entgo.io/ent/entc/integration/gremlin/ent/file" + "entgo.io/ent/entc/integration/gremlin/ent/filetype" + "entgo.io/ent/entc/integration/gremlin/ent/goods" + "entgo.io/ent/entc/integration/gremlin/ent/group" + "entgo.io/ent/entc/integration/gremlin/ent/groupinfo" + "entgo.io/ent/entc/integration/gremlin/ent/item" + "entgo.io/ent/entc/integration/gremlin/ent/license" + "entgo.io/ent/entc/integration/gremlin/ent/node" + "entgo.io/ent/entc/integration/gremlin/ent/pc" + "entgo.io/ent/entc/integration/gremlin/ent/pet" + "entgo.io/ent/entc/integration/gremlin/ent/spec" + enttask "entgo.io/ent/entc/integration/gremlin/ent/task" + "entgo.io/ent/entc/integration/gremlin/ent/user" + "github.com/google/uuid" +) + +const ( + // Operation types. + OpCreate = ent.OpCreate + OpDelete = ent.OpDelete + OpDeleteOne = ent.OpDeleteOne + OpUpdate = ent.OpUpdate + OpUpdateOne = ent.OpUpdateOne + + // Node types. + TypeAPI = "Api" + TypeBuilder = "Builder" + TypeCard = "Card" + TypeComment = "Comment" + TypeDocument = "Document" + TypeExValueScan = "ExValueScan" + TypeFieldType = "FieldType" + TypeFile = "File" + TypeFileType = "FileType" + TypeGoods = "Goods" + TypeGroup = "Group" + TypeGroupInfo = "GroupInfo" + TypeItem = "Item" + TypeLicense = "License" + TypeNode = "Node" + TypePC = "PC" + TypePet = "Pet" + TypeSpec = "Spec" + TypeTask = "Task" + TypeUser = "User" +) + +// APIMutation represents an operation that mutates the Api nodes in the graph. +type APIMutation struct { + api.Mutation + config + id *string + done bool + oldValue func(context.Context) (*Api, error) +} + +var _ ent.Mutation = (*APIMutation)(nil) + +// apiOption allows management of the mutation configuration using functional options. +type apiOption func(*APIMutation) + +// newAPIMutation creates new mutation for the Api entity. +func newAPIMutation(c config, op Op, opts ...apiOption) *APIMutation { + m := &APIMutation{ + Mutation: *api.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *APIMutation) ID() (id string, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withApiID sets the ID field of the mutation. +func withApiID(id string) apiOption { + return func(m *APIMutation) { + var ( + err error + once sync.Once + value *Api + ) + m.oldValue = func(ctx context.Context) (*Api, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Api.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withApi sets the old Api of the mutation. +func withApi(node *Api) apiOption { + return func(m *APIMutation) { + m.oldValue = func(context.Context) (*Api, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m APIMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m APIMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *APIMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().Api.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// 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 *APIMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + return nil, fmt.Errorf("unknown Api field %s", name) +} + +// BuilderMutation represents an operation that mutates the Builder nodes in the graph. +type BuilderMutation struct { + builder.Mutation + config + id *string + done bool + oldValue func(context.Context) (*Builder, error) +} + +var _ ent.Mutation = (*BuilderMutation)(nil) + +// builderOption allows management of the mutation configuration using functional options. +type builderOption func(*BuilderMutation) + +// newBuilderMutation creates new mutation for the Builder entity. +func newBuilderMutation(c config, op Op, opts ...builderOption) *BuilderMutation { + m := &BuilderMutation{ + Mutation: *builder.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *BuilderMutation) ID() (id string, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withBuilderID sets the ID field of the mutation. +func withBuilderID(id string) builderOption { + return func(m *BuilderMutation) { + var ( + err error + once sync.Once + value *Builder + ) + m.oldValue = func(ctx context.Context) (*Builder, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Builder.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withBuilder sets the old Builder of the mutation. +func withBuilder(node *Builder) builderOption { + return func(m *BuilderMutation) { + m.oldValue = func(context.Context) (*Builder, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m BuilderMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m BuilderMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *BuilderMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().Builder.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// 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 *BuilderMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + return nil, fmt.Errorf("unknown Builder field %s", name) +} + +// CardMutation represents an operation that mutates the Card nodes in the graph. +type CardMutation struct { + card.Mutation + config + id *string + done bool + oldValue func(context.Context) (*Card, error) +} + +var _ ent.Mutation = (*CardMutation)(nil) + +// cardOption allows management of the mutation configuration using functional options. +type cardOption func(*CardMutation) + +// newCardMutation creates new mutation for the Card entity. +func newCardMutation(c config, op Op, opts ...cardOption) *CardMutation { + m := &CardMutation{ + Mutation: *card.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *CardMutation) ID() (id string, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withCardID sets the ID field of the mutation. +func withCardID(id string) cardOption { + return func(m *CardMutation) { + var ( + err error + once sync.Once + value *Card + ) + m.oldValue = func(ctx context.Context) (*Card, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Card.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withCard sets the old Card of the mutation. +func withCard(node *Card) cardOption { + return func(m *CardMutation) { + m.oldValue = func(context.Context) (*Card, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m CardMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m CardMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *CardMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().Card.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldCreateTime returns the old "create_time" field's value of the Card entity. +// If the Card object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *CardMutation) OldCreateTime(ctx context.Context) (v time.Time, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldCreateTime is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldCreateTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreateTime: %w", err) + } + return oldValue.CreateTime, nil +} + +// OldUpdateTime returns the old "update_time" field's value of the Card entity. +// If the Card object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *CardMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldUpdateTime is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldUpdateTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdateTime: %w", err) + } + return oldValue.UpdateTime, nil +} + +// OldBalance returns the old "balance" field's value of the Card entity. +// If the Card object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *CardMutation) OldBalance(ctx context.Context) (v float64, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldBalance is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldBalance requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldBalance: %w", err) + } + return oldValue.Balance, nil +} + +// OldNumber returns the old "number" field's value of the Card entity. +// If the Card object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *CardMutation) OldNumber(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNumber is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNumber requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNumber: %w", err) + } + return oldValue.Number, nil +} + +// OldName returns the old "name" field's value of the Card entity. +// If the Card object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *CardMutation) OldName(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// 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 *CardMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case card.FieldCreateTime: + return m.OldCreateTime(ctx) + case card.FieldUpdateTime: + return m.OldUpdateTime(ctx) + case card.FieldBalance: + return m.OldBalance(ctx) + case card.FieldNumber: + return m.OldNumber(ctx) + case card.FieldName: + return m.OldName(ctx) + } + return nil, fmt.Errorf("unknown Card field %s", name) +} + +// CommentMutation represents an operation that mutates the Comment nodes in the graph. +type CommentMutation struct { + comment.Mutation + config + id *string + done bool + oldValue func(context.Context) (*Comment, error) +} + +var _ ent.Mutation = (*CommentMutation)(nil) + +// commentOption allows management of the mutation configuration using functional options. +type commentOption func(*CommentMutation) + +// newCommentMutation creates new mutation for the Comment entity. +func newCommentMutation(c config, op Op, opts ...commentOption) *CommentMutation { + m := &CommentMutation{ + Mutation: *comment.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *CommentMutation) ID() (id string, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withCommentID sets the ID field of the mutation. +func withCommentID(id string) commentOption { + return func(m *CommentMutation) { + var ( + err error + once sync.Once + value *Comment + ) + m.oldValue = func(ctx context.Context) (*Comment, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Comment.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withComment sets the old Comment of the mutation. +func withComment(node *Comment) commentOption { + return func(m *CommentMutation) { + m.oldValue = func(context.Context) (*Comment, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m CommentMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m CommentMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *CommentMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().Comment.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldUniqueInt returns the old "unique_int" field's value of the Comment entity. +// If the Comment object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *CommentMutation) OldUniqueInt(ctx context.Context) (v int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldUniqueInt is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldUniqueInt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUniqueInt: %w", err) + } + return oldValue.UniqueInt, nil +} + +// OldUniqueFloat returns the old "unique_float" field's value of the Comment entity. +// If the Comment object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *CommentMutation) OldUniqueFloat(ctx context.Context) (v float64, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldUniqueFloat is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldUniqueFloat requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUniqueFloat: %w", err) + } + return oldValue.UniqueFloat, nil +} + +// OldNillableInt returns the old "nillable_int" field's value of the Comment entity. +// If the Comment object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *CommentMutation) OldNillableInt(ctx context.Context) (v *int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNillableInt is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNillableInt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNillableInt: %w", err) + } + return oldValue.NillableInt, nil +} + +// OldTable returns the old "table" field's value of the Comment entity. +// If the Comment object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *CommentMutation) OldTable(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldTable is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldTable requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTable: %w", err) + } + return oldValue.Table, nil +} + +// OldDir returns the old "dir" field's value of the Comment entity. +// If the Comment object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *CommentMutation) OldDir(ctx context.Context) (v schemadir.Dir, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldDir is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldDir requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDir: %w", err) + } + return oldValue.Dir, nil +} + +// OldClient returns the old "client" field's value of the Comment entity. +// If the Comment object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *CommentMutation) OldClient(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldClient is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldClient requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldClient: %w", err) + } + return oldValue.Client, nil +} + +// 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 *CommentMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case comment.FieldUniqueInt: + return m.OldUniqueInt(ctx) + case comment.FieldUniqueFloat: + return m.OldUniqueFloat(ctx) + case comment.FieldNillableInt: + return m.OldNillableInt(ctx) + case comment.FieldTable: + return m.OldTable(ctx) + case comment.FieldDir: + return m.OldDir(ctx) + case comment.FieldClient: + return m.OldClient(ctx) + } + return nil, fmt.Errorf("unknown Comment field %s", name) +} + +// DocumentMutation represents an operation that mutates the Document nodes in the graph. +type DocumentMutation struct { + document.Mutation + config + id *string + done bool + oldValue func(context.Context) (*Document, error) +} + +var _ ent.Mutation = (*DocumentMutation)(nil) + +// documentOption allows management of the mutation configuration using functional options. +type documentOption func(*DocumentMutation) + +// newDocumentMutation creates new mutation for the Document entity. +func newDocumentMutation(c config, op Op, opts ...documentOption) *DocumentMutation { + m := &DocumentMutation{ + Mutation: *document.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *DocumentMutation) ID() (id string, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withDocumentID sets the ID field of the mutation. +func withDocumentID(id string) documentOption { + return func(m *DocumentMutation) { + var ( + err error + once sync.Once + value *Document + ) + m.oldValue = func(ctx context.Context) (*Document, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Document.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withDocument sets the old Document of the mutation. +func withDocument(node *Document) documentOption { + return func(m *DocumentMutation) { + m.oldValue = func(context.Context) (*Document, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m DocumentMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m DocumentMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *DocumentMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().Document.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldName returns the old "name" field's value of the Document entity. +// If the Document object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DocumentMutation) OldName(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// OldAttachment returns the old "attachment" field's value of the Document entity. +// If the Document object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DocumentMutation) OldAttachment(ctx context.Context) (v []byte, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldAttachment is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldAttachment requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAttachment: %w", err) + } + return oldValue.Attachment, nil +} + +// OldMetadata returns the old "metadata" field's value of the Document entity. +// If the Document object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DocumentMutation) OldMetadata(ctx context.Context) (v []byte, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldMetadata is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldMetadata requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMetadata: %w", err) + } + return oldValue.Metadata, nil +} + +// OldPayload returns the old "payload" field's value of the Document entity. +// If the Document object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DocumentMutation) OldPayload(ctx context.Context) (v *schema.DocPayload, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldPayload is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldPayload requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPayload: %w", err) + } + return oldValue.Payload, nil +} + +// OldDescription returns the old "description" field's value of the Document entity. +// If the Document object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DocumentMutation) OldDescription(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldDescription is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldDescription requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDescription: %w", err) + } + return oldValue.Description, nil +} + +// 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 *DocumentMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case document.FieldName: + return m.OldName(ctx) + case document.FieldAttachment: + return m.OldAttachment(ctx) + case document.FieldMetadata: + return m.OldMetadata(ctx) + case document.FieldPayload: + return m.OldPayload(ctx) + case document.FieldDescription: + return m.OldDescription(ctx) + } + return nil, fmt.Errorf("unknown Document field %s", name) +} + +// ExValueScanMutation represents an operation that mutates the ExValueScan nodes in the graph. +type ExValueScanMutation struct { + exvaluescan.Mutation + config + id *string + done bool + oldValue func(context.Context) (*ExValueScan, error) +} + +var _ ent.Mutation = (*ExValueScanMutation)(nil) + +// exvaluescanOption allows management of the mutation configuration using functional options. +type exvaluescanOption func(*ExValueScanMutation) + +// newExValueScanMutation creates new mutation for the ExValueScan entity. +func newExValueScanMutation(c config, op Op, opts ...exvaluescanOption) *ExValueScanMutation { + m := &ExValueScanMutation{ + Mutation: *exvaluescan.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *ExValueScanMutation) ID() (id string, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withExValueScanID sets the ID field of the mutation. +func withExValueScanID(id string) exvaluescanOption { + return func(m *ExValueScanMutation) { + var ( + err error + once sync.Once + value *ExValueScan + ) + m.oldValue = func(ctx context.Context) (*ExValueScan, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().ExValueScan.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withExValueScan sets the old ExValueScan of the mutation. +func withExValueScan(node *ExValueScan) exvaluescanOption { + return func(m *ExValueScanMutation) { + m.oldValue = func(context.Context) (*ExValueScan, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m ExValueScanMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m ExValueScanMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *ExValueScanMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().ExValueScan.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldBinary returns the old "binary" field's value of the ExValueScan entity. +// If the ExValueScan object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *ExValueScanMutation) OldBinary(ctx context.Context) (v *url.URL, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldBinary is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldBinary requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldBinary: %w", err) + } + return oldValue.Binary, nil +} + +// OldBinaryBytes returns the old "binary_bytes" field's value of the ExValueScan entity. +// If the ExValueScan object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *ExValueScanMutation) OldBinaryBytes(ctx context.Context) (v *url.URL, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldBinaryBytes is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldBinaryBytes requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldBinaryBytes: %w", err) + } + return oldValue.BinaryBytes, nil +} + +// OldBinaryOptional returns the old "binary_optional" field's value of the ExValueScan entity. +// If the ExValueScan object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *ExValueScanMutation) OldBinaryOptional(ctx context.Context) (v *url.URL, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldBinaryOptional is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldBinaryOptional requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldBinaryOptional: %w", err) + } + return oldValue.BinaryOptional, nil +} + +// OldText returns the old "text" field's value of the ExValueScan entity. +// If the ExValueScan object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *ExValueScanMutation) OldText(ctx context.Context) (v *big.Int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldText is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldText requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldText: %w", err) + } + return oldValue.Text, nil +} + +// OldTextOptional returns the old "text_optional" field's value of the ExValueScan entity. +// If the ExValueScan object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *ExValueScanMutation) OldTextOptional(ctx context.Context) (v *big.Int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldTextOptional is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldTextOptional requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTextOptional: %w", err) + } + return oldValue.TextOptional, nil +} + +// OldBase64 returns the old "base64" field's value of the ExValueScan entity. +// If the ExValueScan object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *ExValueScanMutation) OldBase64(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldBase64 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldBase64 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldBase64: %w", err) + } + return oldValue.Base64, nil +} + +// OldCustom returns the old "custom" field's value of the ExValueScan entity. +// If the ExValueScan object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *ExValueScanMutation) OldCustom(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldCustom is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldCustom requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCustom: %w", err) + } + return oldValue.Custom, nil +} + +// OldCustomOptional returns the old "custom_optional" field's value of the ExValueScan entity. +// If the ExValueScan object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *ExValueScanMutation) OldCustomOptional(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldCustomOptional is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldCustomOptional requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCustomOptional: %w", err) + } + return oldValue.CustomOptional, nil +} + +// 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 *ExValueScanMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case exvaluescan.FieldBinary: + return m.OldBinary(ctx) + case exvaluescan.FieldBinaryBytes: + return m.OldBinaryBytes(ctx) + case exvaluescan.FieldBinaryOptional: + return m.OldBinaryOptional(ctx) + case exvaluescan.FieldText: + return m.OldText(ctx) + case exvaluescan.FieldTextOptional: + return m.OldTextOptional(ctx) + case exvaluescan.FieldBase64: + return m.OldBase64(ctx) + case exvaluescan.FieldCustom: + return m.OldCustom(ctx) + case exvaluescan.FieldCustomOptional: + return m.OldCustomOptional(ctx) + } + return nil, fmt.Errorf("unknown ExValueScan field %s", name) +} + +// FieldTypeMutation represents an operation that mutates the FieldType nodes in the graph. +type FieldTypeMutation struct { + fieldtype.Mutation + config + id *string + done bool + oldValue func(context.Context) (*FieldType, error) +} + +var _ ent.Mutation = (*FieldTypeMutation)(nil) + +// fieldtypeOption allows management of the mutation configuration using functional options. +type fieldtypeOption func(*FieldTypeMutation) + +// newFieldTypeMutation creates new mutation for the FieldType entity. +func newFieldTypeMutation(c config, op Op, opts ...fieldtypeOption) *FieldTypeMutation { + m := &FieldTypeMutation{ + Mutation: *fieldtype.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *FieldTypeMutation) ID() (id string, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withFieldTypeID sets the ID field of the mutation. +func withFieldTypeID(id string) fieldtypeOption { + return func(m *FieldTypeMutation) { + var ( + err error + once sync.Once + value *FieldType + ) + m.oldValue = func(ctx context.Context) (*FieldType, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().FieldType.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withFieldType sets the old FieldType of the mutation. +func withFieldType(node *FieldType) fieldtypeOption { + return func(m *FieldTypeMutation) { + m.oldValue = func(context.Context) (*FieldType, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m FieldTypeMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m FieldTypeMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *FieldTypeMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().FieldType.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldInt returns the old "int" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldInt(ctx context.Context) (v int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldInt is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldInt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldInt: %w", err) + } + return oldValue.Int, nil +} + +// OldInt8 returns the old "int8" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldInt8(ctx context.Context) (v int8, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldInt8 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldInt8 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldInt8: %w", err) + } + return oldValue.Int8, nil +} + +// OldInt16 returns the old "int16" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldInt16(ctx context.Context) (v int16, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldInt16 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldInt16 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldInt16: %w", err) + } + return oldValue.Int16, nil +} + +// OldInt32 returns the old "int32" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldInt32(ctx context.Context) (v int32, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldInt32 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldInt32 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldInt32: %w", err) + } + return oldValue.Int32, nil +} + +// OldInt64 returns the old "int64" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldInt64(ctx context.Context) (v int64, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldInt64 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldInt64 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldInt64: %w", err) + } + return oldValue.Int64, nil +} + +// OldOptionalInt returns the old "optional_int" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldOptionalInt(ctx context.Context) (v int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalInt is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalInt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalInt: %w", err) + } + return oldValue.OptionalInt, nil +} + +// OldOptionalInt8 returns the old "optional_int8" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldOptionalInt8(ctx context.Context) (v int8, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalInt8 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalInt8 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalInt8: %w", err) + } + return oldValue.OptionalInt8, nil +} + +// OldOptionalInt16 returns the old "optional_int16" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldOptionalInt16(ctx context.Context) (v int16, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalInt16 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalInt16 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalInt16: %w", err) + } + return oldValue.OptionalInt16, nil +} + +// OldOptionalInt32 returns the old "optional_int32" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldOptionalInt32(ctx context.Context) (v int32, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalInt32 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalInt32 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalInt32: %w", err) + } + return oldValue.OptionalInt32, nil +} + +// OldOptionalInt64 returns the old "optional_int64" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldOptionalInt64(ctx context.Context) (v int64, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalInt64 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalInt64 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalInt64: %w", err) + } + return oldValue.OptionalInt64, nil +} + +// OldNillableInt returns the old "nillable_int" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldNillableInt(ctx context.Context) (v *int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNillableInt is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNillableInt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNillableInt: %w", err) + } + return oldValue.NillableInt, nil +} + +// OldNillableInt8 returns the old "nillable_int8" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldNillableInt8(ctx context.Context) (v *int8, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNillableInt8 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNillableInt8 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNillableInt8: %w", err) + } + return oldValue.NillableInt8, nil +} + +// OldNillableInt16 returns the old "nillable_int16" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldNillableInt16(ctx context.Context) (v *int16, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNillableInt16 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNillableInt16 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNillableInt16: %w", err) + } + return oldValue.NillableInt16, nil +} + +// OldNillableInt32 returns the old "nillable_int32" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldNillableInt32(ctx context.Context) (v *int32, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNillableInt32 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNillableInt32 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNillableInt32: %w", err) + } + return oldValue.NillableInt32, nil +} + +// OldNillableInt64 returns the old "nillable_int64" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldNillableInt64(ctx context.Context) (v *int64, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNillableInt64 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNillableInt64 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNillableInt64: %w", err) + } + return oldValue.NillableInt64, nil +} + +// OldValidateOptionalInt32 returns the old "validate_optional_int32" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldValidateOptionalInt32(ctx context.Context) (v int32, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldValidateOptionalInt32 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldValidateOptionalInt32 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldValidateOptionalInt32: %w", err) + } + return oldValue.ValidateOptionalInt32, nil +} + +// OldOptionalUint returns the old "optional_uint" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldOptionalUint(ctx context.Context) (v uint, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalUint is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalUint requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalUint: %w", err) + } + return oldValue.OptionalUint, nil +} + +// OldOptionalUint8 returns the old "optional_uint8" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldOptionalUint8(ctx context.Context) (v uint8, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalUint8 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalUint8 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalUint8: %w", err) + } + return oldValue.OptionalUint8, nil +} + +// OldOptionalUint16 returns the old "optional_uint16" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldOptionalUint16(ctx context.Context) (v uint16, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalUint16 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalUint16 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalUint16: %w", err) + } + return oldValue.OptionalUint16, nil +} + +// OldOptionalUint32 returns the old "optional_uint32" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldOptionalUint32(ctx context.Context) (v uint32, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalUint32 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalUint32 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalUint32: %w", err) + } + return oldValue.OptionalUint32, nil +} + +// OldOptionalUint64 returns the old "optional_uint64" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldOptionalUint64(ctx context.Context) (v uint64, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalUint64 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalUint64 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalUint64: %w", err) + } + return oldValue.OptionalUint64, nil +} + +// OldState returns the old "state" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldState(ctx context.Context) (v fieldtype.State, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldState is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldState requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldState: %w", err) + } + return oldValue.State, nil +} + +// OldOptionalFloat returns the old "optional_float" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldOptionalFloat(ctx context.Context) (v float64, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalFloat is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalFloat requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalFloat: %w", err) + } + return oldValue.OptionalFloat, nil +} + +// OldOptionalFloat32 returns the old "optional_float32" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldOptionalFloat32(ctx context.Context) (v float32, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalFloat32 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalFloat32 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalFloat32: %w", err) + } + return oldValue.OptionalFloat32, nil +} + +// OldText returns the old "text" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldText(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldText is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldText requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldText: %w", err) + } + return oldValue.Text, nil +} + +// OldDatetime returns the old "datetime" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldDatetime(ctx context.Context) (v time.Time, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldDatetime is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldDatetime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDatetime: %w", err) + } + return oldValue.Datetime, nil +} + +// OldDecimal returns the old "decimal" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldDecimal(ctx context.Context) (v float64, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldDecimal is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldDecimal requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDecimal: %w", err) + } + return oldValue.Decimal, nil +} + +// OldLinkOther returns the old "link_other" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldLinkOther(ctx context.Context) (v *schema.Link, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldLinkOther is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldLinkOther requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLinkOther: %w", err) + } + return oldValue.LinkOther, nil +} + +// OldLinkOtherFunc returns the old "link_other_func" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldLinkOtherFunc(ctx context.Context) (v *schema.Link, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldLinkOtherFunc is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldLinkOtherFunc requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLinkOtherFunc: %w", err) + } + return oldValue.LinkOtherFunc, nil +} + +// OldMAC returns the old "mac" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldMAC(ctx context.Context) (v schema.MAC, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldMAC is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldMAC requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMAC: %w", err) + } + return oldValue.MAC, nil +} + +// OldStringArray returns the old "string_array" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldStringArray(ctx context.Context) (v schema.Strings, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldStringArray is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldStringArray requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldStringArray: %w", err) + } + return oldValue.StringArray, nil +} + +// OldPassword returns the old "password" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldPassword(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldPassword is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldPassword requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPassword: %w", err) + } + return oldValue.Password, nil +} + +// OldStringScanner returns the old "string_scanner" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldStringScanner(ctx context.Context) (v *schema.StringScanner, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldStringScanner is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldStringScanner requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldStringScanner: %w", err) + } + return oldValue.StringScanner, nil +} + +// OldDuration returns the old "duration" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldDuration(ctx context.Context) (v time.Duration, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldDuration is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldDuration requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDuration: %w", err) + } + return oldValue.Duration, nil +} + +// OldDir returns the old "dir" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldDir(ctx context.Context) (v http.Dir, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldDir is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldDir requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDir: %w", err) + } + return oldValue.Dir, nil +} + +// OldNdir returns the old "ndir" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldNdir(ctx context.Context) (v *http.Dir, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNdir is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNdir requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNdir: %w", err) + } + return oldValue.Ndir, nil +} + +// OldStr returns the old "str" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldStr(ctx context.Context) (v sql.NullString, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldStr is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldStr requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldStr: %w", err) + } + return oldValue.Str, nil +} + +// OldNullStr returns the old "null_str" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldNullStr(ctx context.Context) (v *sql.NullString, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNullStr is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNullStr requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNullStr: %w", err) + } + return oldValue.NullStr, nil +} + +// OldLink returns the old "link" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldLink(ctx context.Context) (v schema.Link, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldLink is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldLink requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLink: %w", err) + } + return oldValue.Link, nil +} + +// OldNullLink returns the old "null_link" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldNullLink(ctx context.Context) (v *schema.Link, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNullLink is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNullLink requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNullLink: %w", err) + } + return oldValue.NullLink, nil +} + +// OldActive returns the old "active" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldActive(ctx context.Context) (v schema.Status, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldActive is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldActive requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldActive: %w", err) + } + return oldValue.Active, nil +} + +// OldNullActive returns the old "null_active" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldNullActive(ctx context.Context) (v *schema.Status, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNullActive is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNullActive requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNullActive: %w", err) + } + return oldValue.NullActive, nil +} + +// OldDeleted returns the old "deleted" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldDeleted(ctx context.Context) (v *sql.NullBool, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldDeleted is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldDeleted requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeleted: %w", err) + } + return oldValue.Deleted, nil +} + +// OldDeletedAt returns the old "deleted_at" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldDeletedAt(ctx context.Context) (v *sql.NullTime, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// OldRawData returns the old "raw_data" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldRawData(ctx context.Context) (v []byte, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldRawData is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldRawData requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRawData: %w", err) + } + return oldValue.RawData, nil +} + +// OldSensitive returns the old "sensitive" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldSensitive(ctx context.Context) (v []byte, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldSensitive is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldSensitive requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSensitive: %w", err) + } + return oldValue.Sensitive, nil +} + +// OldIP returns the old "ip" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldIP(ctx context.Context) (v net.IP, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldIP is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldIP requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldIP: %w", err) + } + return oldValue.IP, nil +} + +// OldNullInt64 returns the old "null_int64" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldNullInt64(ctx context.Context) (v *sql.NullInt64, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNullInt64 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNullInt64 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNullInt64: %w", err) + } + return oldValue.NullInt64, nil +} + +// OldSchemaInt returns the old "schema_int" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldSchemaInt(ctx context.Context) (v schema.Int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldSchemaInt is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldSchemaInt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSchemaInt: %w", err) + } + return oldValue.SchemaInt, nil +} + +// OldSchemaInt8 returns the old "schema_int8" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldSchemaInt8(ctx context.Context) (v schema.Int8, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldSchemaInt8 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldSchemaInt8 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSchemaInt8: %w", err) + } + return oldValue.SchemaInt8, nil +} + +// OldSchemaInt64 returns the old "schema_int64" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldSchemaInt64(ctx context.Context) (v schema.Int64, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldSchemaInt64 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldSchemaInt64 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSchemaInt64: %w", err) + } + return oldValue.SchemaInt64, nil +} + +// OldSchemaFloat returns the old "schema_float" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldSchemaFloat(ctx context.Context) (v schema.Float64, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldSchemaFloat is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldSchemaFloat requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSchemaFloat: %w", err) + } + return oldValue.SchemaFloat, nil +} + +// OldSchemaFloat32 returns the old "schema_float32" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldSchemaFloat32(ctx context.Context) (v schema.Float32, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldSchemaFloat32 is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldSchemaFloat32 requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSchemaFloat32: %w", err) + } + return oldValue.SchemaFloat32, nil +} + +// OldNullFloat returns the old "null_float" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldNullFloat(ctx context.Context) (v *sql.NullFloat64, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNullFloat is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNullFloat requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNullFloat: %w", err) + } + return oldValue.NullFloat, nil +} + +// OldRole returns the old "role" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldRole(ctx context.Context) (v role.Role, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldRole is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldRole requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRole: %w", err) + } + return oldValue.Role, nil +} + +// OldPriority returns the old "priority" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldPriority(ctx context.Context) (v role.Priority, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldPriority is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldPriority requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPriority: %w", err) + } + return oldValue.Priority, nil +} + +// OldOptionalUUID returns the old "optional_uuid" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldOptionalUUID(ctx context.Context) (v uuid.UUID, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalUUID is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalUUID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalUUID: %w", err) + } + return oldValue.OptionalUUID, nil +} + +// OldNillableUUID returns the old "nillable_uuid" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldNillableUUID(ctx context.Context) (v *uuid.UUID, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNillableUUID is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNillableUUID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNillableUUID: %w", err) + } + return oldValue.NillableUUID, nil +} + +// OldStrings returns the old "strings" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldStrings(ctx context.Context) (v []string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldStrings is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldStrings requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldStrings: %w", err) + } + return oldValue.Strings, nil +} + +// OldPair returns the old "pair" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldPair(ctx context.Context) (v schema.Pair, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldPair is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldPair requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPair: %w", err) + } + return oldValue.Pair, nil +} + +// OldNilPair returns the old "nil_pair" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldNilPair(ctx context.Context) (v *schema.Pair, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNilPair is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNilPair requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNilPair: %w", err) + } + return oldValue.NilPair, nil +} + +// OldVstring returns the old "vstring" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldVstring(ctx context.Context) (v schema.VString, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldVstring is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldVstring requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldVstring: %w", err) + } + return oldValue.Vstring, nil +} + +// OldTriple returns the old "triple" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldTriple(ctx context.Context) (v schema.Triple, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldTriple is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldTriple requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTriple: %w", err) + } + return oldValue.Triple, nil +} + +// OldBigInt returns the old "big_int" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldBigInt(ctx context.Context) (v schema.BigInt, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldBigInt is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldBigInt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldBigInt: %w", err) + } + return oldValue.BigInt, nil +} + +// OldPasswordOther returns the old "password_other" field's value of the FieldType entity. +// If the FieldType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FieldTypeMutation) OldPasswordOther(ctx context.Context) (v schema.Password, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldPasswordOther is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldPasswordOther requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPasswordOther: %w", err) + } + return oldValue.PasswordOther, nil +} + +// 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 *FieldTypeMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case fieldtype.FieldInt: + return m.OldInt(ctx) + case fieldtype.FieldInt8: + return m.OldInt8(ctx) + case fieldtype.FieldInt16: + return m.OldInt16(ctx) + case fieldtype.FieldInt32: + return m.OldInt32(ctx) + case fieldtype.FieldInt64: + return m.OldInt64(ctx) + case fieldtype.FieldOptionalInt: + return m.OldOptionalInt(ctx) + case fieldtype.FieldOptionalInt8: + return m.OldOptionalInt8(ctx) + case fieldtype.FieldOptionalInt16: + return m.OldOptionalInt16(ctx) + case fieldtype.FieldOptionalInt32: + return m.OldOptionalInt32(ctx) + case fieldtype.FieldOptionalInt64: + return m.OldOptionalInt64(ctx) + case fieldtype.FieldNillableInt: + return m.OldNillableInt(ctx) + case fieldtype.FieldNillableInt8: + return m.OldNillableInt8(ctx) + case fieldtype.FieldNillableInt16: + return m.OldNillableInt16(ctx) + case fieldtype.FieldNillableInt32: + return m.OldNillableInt32(ctx) + case fieldtype.FieldNillableInt64: + return m.OldNillableInt64(ctx) + case fieldtype.FieldValidateOptionalInt32: + return m.OldValidateOptionalInt32(ctx) + case fieldtype.FieldOptionalUint: + return m.OldOptionalUint(ctx) + case fieldtype.FieldOptionalUint8: + return m.OldOptionalUint8(ctx) + case fieldtype.FieldOptionalUint16: + return m.OldOptionalUint16(ctx) + case fieldtype.FieldOptionalUint32: + return m.OldOptionalUint32(ctx) + case fieldtype.FieldOptionalUint64: + return m.OldOptionalUint64(ctx) + case fieldtype.FieldState: + return m.OldState(ctx) + case fieldtype.FieldOptionalFloat: + return m.OldOptionalFloat(ctx) + case fieldtype.FieldOptionalFloat32: + return m.OldOptionalFloat32(ctx) + case fieldtype.FieldText: + return m.OldText(ctx) + case fieldtype.FieldDatetime: + return m.OldDatetime(ctx) + case fieldtype.FieldDecimal: + return m.OldDecimal(ctx) + case fieldtype.FieldLinkOther: + return m.OldLinkOther(ctx) + case fieldtype.FieldLinkOtherFunc: + return m.OldLinkOtherFunc(ctx) + case fieldtype.FieldMAC: + return m.OldMAC(ctx) + case fieldtype.FieldStringArray: + return m.OldStringArray(ctx) + case fieldtype.FieldPassword: + return m.OldPassword(ctx) + case fieldtype.FieldStringScanner: + return m.OldStringScanner(ctx) + case fieldtype.FieldDuration: + return m.OldDuration(ctx) + case fieldtype.FieldDir: + return m.OldDir(ctx) + case fieldtype.FieldNdir: + return m.OldNdir(ctx) + case fieldtype.FieldStr: + return m.OldStr(ctx) + case fieldtype.FieldNullStr: + return m.OldNullStr(ctx) + case fieldtype.FieldLink: + return m.OldLink(ctx) + case fieldtype.FieldNullLink: + return m.OldNullLink(ctx) + case fieldtype.FieldActive: + return m.OldActive(ctx) + case fieldtype.FieldNullActive: + return m.OldNullActive(ctx) + case fieldtype.FieldDeleted: + return m.OldDeleted(ctx) + case fieldtype.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case fieldtype.FieldRawData: + return m.OldRawData(ctx) + case fieldtype.FieldSensitive: + return m.OldSensitive(ctx) + case fieldtype.FieldIP: + return m.OldIP(ctx) + case fieldtype.FieldNullInt64: + return m.OldNullInt64(ctx) + case fieldtype.FieldSchemaInt: + return m.OldSchemaInt(ctx) + case fieldtype.FieldSchemaInt8: + return m.OldSchemaInt8(ctx) + case fieldtype.FieldSchemaInt64: + return m.OldSchemaInt64(ctx) + case fieldtype.FieldSchemaFloat: + return m.OldSchemaFloat(ctx) + case fieldtype.FieldSchemaFloat32: + return m.OldSchemaFloat32(ctx) + case fieldtype.FieldNullFloat: + return m.OldNullFloat(ctx) + case fieldtype.FieldRole: + return m.OldRole(ctx) + case fieldtype.FieldPriority: + return m.OldPriority(ctx) + case fieldtype.FieldOptionalUUID: + return m.OldOptionalUUID(ctx) + case fieldtype.FieldNillableUUID: + return m.OldNillableUUID(ctx) + case fieldtype.FieldStrings: + return m.OldStrings(ctx) + case fieldtype.FieldPair: + return m.OldPair(ctx) + case fieldtype.FieldNilPair: + return m.OldNilPair(ctx) + case fieldtype.FieldVstring: + return m.OldVstring(ctx) + case fieldtype.FieldTriple: + return m.OldTriple(ctx) + case fieldtype.FieldBigInt: + return m.OldBigInt(ctx) + case fieldtype.FieldPasswordOther: + return m.OldPasswordOther(ctx) + } + return nil, fmt.Errorf("unknown FieldType field %s", name) +} + +// FileMutation represents an operation that mutates the File nodes in the graph. +type FileMutation struct { + file.Mutation + config + id *string + done bool + oldValue func(context.Context) (*File, error) +} + +var _ ent.Mutation = (*FileMutation)(nil) + +// fileOption allows management of the mutation configuration using functional options. +type fileOption func(*FileMutation) + +// newFileMutation creates new mutation for the File entity. +func newFileMutation(c config, op Op, opts ...fileOption) *FileMutation { + m := &FileMutation{ + Mutation: *file.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *FileMutation) ID() (id string, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withFileID sets the ID field of the mutation. +func withFileID(id string) fileOption { + return func(m *FileMutation) { + var ( + err error + once sync.Once + value *File + ) + m.oldValue = func(ctx context.Context) (*File, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().File.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withFile sets the old File of the mutation. +func withFile(node *File) fileOption { + return func(m *FileMutation) { + m.oldValue = func(context.Context) (*File, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m FileMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m FileMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *FileMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().File.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldSetID returns the old "set_id" field's value of the File entity. +// If the File object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FileMutation) OldSetID(ctx context.Context) (v int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldSetID is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldSetID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSetID: %w", err) + } + return oldValue.SetID, nil +} + +// OldSize returns the old "size" field's value of the File entity. +// If the File object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FileMutation) OldSize(ctx context.Context) (v int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldSize is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldSize requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSize: %w", err) + } + return oldValue.Size, nil +} + +// OldName returns the old "name" field's value of the File entity. +// If the File object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FileMutation) OldName(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// OldUser returns the old "user" field's value of the File entity. +// If the File object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FileMutation) OldUser(ctx context.Context) (v *string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldUser is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldUser requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUser: %w", err) + } + return oldValue.User, nil +} + +// OldGroup returns the old "group" field's value of the File entity. +// If the File object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FileMutation) OldGroup(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldGroup is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldGroup requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldGroup: %w", err) + } + return oldValue.Group, nil +} + +// OldOp returns the old "op" field's value of the File entity. +// If the File object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FileMutation) OldOp(ctx context.Context) (v bool, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOp is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOp requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOp: %w", err) + } + return oldValue.Op, nil +} + +// OldFieldID returns the old "field_id" field's value of the File entity. +// If the File object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FileMutation) OldFieldID(ctx context.Context) (v int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldFieldID is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldFieldID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldFieldID: %w", err) + } + return oldValue.FieldID, nil +} + +// OldCreateTime returns the old "create_time" field's value of the File entity. +// If the File object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FileMutation) OldCreateTime(ctx context.Context) (v time.Time, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldCreateTime is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldCreateTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreateTime: %w", err) + } + return oldValue.CreateTime, nil +} + +// 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 *FileMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case file.FieldSetID: + return m.OldSetID(ctx) + case file.FieldSize: + return m.OldSize(ctx) + case file.FieldName: + return m.OldName(ctx) + case file.FieldUser: + return m.OldUser(ctx) + case file.FieldGroup: + return m.OldGroup(ctx) + case file.FieldOp: + return m.OldOp(ctx) + case file.FieldFieldID: + return m.OldFieldID(ctx) + case file.FieldCreateTime: + return m.OldCreateTime(ctx) + } + return nil, fmt.Errorf("unknown File field %s", name) +} + +// FileTypeMutation represents an operation that mutates the FileType nodes in the graph. +type FileTypeMutation struct { + filetype.Mutation + config + id *string + done bool + oldValue func(context.Context) (*FileType, error) +} + +var _ ent.Mutation = (*FileTypeMutation)(nil) + +// filetypeOption allows management of the mutation configuration using functional options. +type filetypeOption func(*FileTypeMutation) + +// newFileTypeMutation creates new mutation for the FileType entity. +func newFileTypeMutation(c config, op Op, opts ...filetypeOption) *FileTypeMutation { + m := &FileTypeMutation{ + Mutation: *filetype.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *FileTypeMutation) ID() (id string, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withFileTypeID sets the ID field of the mutation. +func withFileTypeID(id string) filetypeOption { + return func(m *FileTypeMutation) { + var ( + err error + once sync.Once + value *FileType + ) + m.oldValue = func(ctx context.Context) (*FileType, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().FileType.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withFileType sets the old FileType of the mutation. +func withFileType(node *FileType) filetypeOption { + return func(m *FileTypeMutation) { + m.oldValue = func(context.Context) (*FileType, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m FileTypeMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m FileTypeMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *FileTypeMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().FileType.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldName returns the old "name" field's value of the FileType entity. +// If the FileType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FileTypeMutation) OldName(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// OldType returns the old "type" field's value of the FileType entity. +// If the FileType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FileTypeMutation) OldType(ctx context.Context) (v filetype.Type, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldType is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldType requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldType: %w", err) + } + return oldValue.Type, nil +} + +// OldState returns the old "state" field's value of the FileType entity. +// If the FileType object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *FileTypeMutation) OldState(ctx context.Context) (v filetype.State, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldState is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldState requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldState: %w", err) + } + return oldValue.State, nil +} + +// 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 *FileTypeMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case filetype.FieldName: + return m.OldName(ctx) + case filetype.FieldType: + return m.OldType(ctx) + case filetype.FieldState: + return m.OldState(ctx) + } + return nil, fmt.Errorf("unknown FileType field %s", name) +} + +// GoodsMutation represents an operation that mutates the Goods nodes in the graph. +type GoodsMutation struct { + goods.Mutation + config + id *string + done bool + oldValue func(context.Context) (*Goods, error) +} + +var _ ent.Mutation = (*GoodsMutation)(nil) + +// goodsOption allows management of the mutation configuration using functional options. +type goodsOption func(*GoodsMutation) + +// newGoodsMutation creates new mutation for the Goods entity. +func newGoodsMutation(c config, op Op, opts ...goodsOption) *GoodsMutation { + m := &GoodsMutation{ + Mutation: *goods.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *GoodsMutation) ID() (id string, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withGoodsID sets the ID field of the mutation. +func withGoodsID(id string) goodsOption { + return func(m *GoodsMutation) { + var ( + err error + once sync.Once + value *Goods + ) + m.oldValue = func(ctx context.Context) (*Goods, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Goods.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withGoods sets the old Goods of the mutation. +func withGoods(node *Goods) goodsOption { + return func(m *GoodsMutation) { + m.oldValue = func(context.Context) (*Goods, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m GoodsMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m GoodsMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *GoodsMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().Goods.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// 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 *GoodsMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + return nil, fmt.Errorf("unknown Goods field %s", name) +} + +// GroupMutation represents an operation that mutates the Group nodes in the graph. +type GroupMutation struct { + group.Mutation + config + id *string + done bool + oldValue func(context.Context) (*Group, error) +} + +var _ ent.Mutation = (*GroupMutation)(nil) + +// groupOption allows management of the mutation configuration using functional options. +type groupOption func(*GroupMutation) + +// newGroupMutation creates new mutation for the Group entity. +func newGroupMutation(c config, op Op, opts ...groupOption) *GroupMutation { + m := &GroupMutation{ + Mutation: *group.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *GroupMutation) ID() (id string, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withGroupID sets the ID field of the mutation. +func withGroupID(id string) groupOption { + return func(m *GroupMutation) { + var ( + err error + once sync.Once + value *Group + ) + m.oldValue = func(ctx context.Context) (*Group, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Group.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withGroup sets the old Group of the mutation. +func withGroup(node *Group) groupOption { + return func(m *GroupMutation) { + m.oldValue = func(context.Context) (*Group, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m GroupMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m GroupMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *GroupMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().Group.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldActive returns the old "active" field's value of the Group entity. +// If the Group object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *GroupMutation) OldActive(ctx context.Context) (v bool, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldActive is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldActive requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldActive: %w", err) + } + return oldValue.Active, nil +} + +// OldExpire returns the old "expire" field's value of the Group entity. +// If the Group object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *GroupMutation) OldExpire(ctx context.Context) (v time.Time, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldExpire is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldExpire requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldExpire: %w", err) + } + return oldValue.Expire, nil +} + +// OldType returns the old "type" field's value of the Group entity. +// If the Group object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *GroupMutation) OldType(ctx context.Context) (v *string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldType is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldType requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldType: %w", err) + } + return oldValue.Type, nil +} + +// OldMaxUsers returns the old "max_users" field's value of the Group entity. +// If the Group object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *GroupMutation) OldMaxUsers(ctx context.Context) (v int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldMaxUsers is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldMaxUsers requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMaxUsers: %w", err) + } + return oldValue.MaxUsers, nil +} + +// OldName returns the old "name" field's value of the Group entity. +// If the Group object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *GroupMutation) OldName(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// 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 *GroupMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case group.FieldActive: + return m.OldActive(ctx) + case group.FieldExpire: + return m.OldExpire(ctx) + case group.FieldType: + return m.OldType(ctx) + case group.FieldMaxUsers: + return m.OldMaxUsers(ctx) + case group.FieldName: + return m.OldName(ctx) + } + return nil, fmt.Errorf("unknown Group field %s", name) +} + +// GroupInfoMutation represents an operation that mutates the GroupInfo nodes in the graph. +type GroupInfoMutation struct { + groupinfo.Mutation + config + id *string + done bool + oldValue func(context.Context) (*GroupInfo, error) +} + +var _ ent.Mutation = (*GroupInfoMutation)(nil) + +// groupinfoOption allows management of the mutation configuration using functional options. +type groupinfoOption func(*GroupInfoMutation) + +// newGroupInfoMutation creates new mutation for the GroupInfo entity. +func newGroupInfoMutation(c config, op Op, opts ...groupinfoOption) *GroupInfoMutation { + m := &GroupInfoMutation{ + Mutation: *groupinfo.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *GroupInfoMutation) ID() (id string, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withGroupInfoID sets the ID field of the mutation. +func withGroupInfoID(id string) groupinfoOption { + return func(m *GroupInfoMutation) { + var ( + err error + once sync.Once + value *GroupInfo + ) + m.oldValue = func(ctx context.Context) (*GroupInfo, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().GroupInfo.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withGroupInfo sets the old GroupInfo of the mutation. +func withGroupInfo(node *GroupInfo) groupinfoOption { + return func(m *GroupInfoMutation) { + m.oldValue = func(context.Context) (*GroupInfo, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m GroupInfoMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m GroupInfoMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *GroupInfoMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().GroupInfo.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldDesc returns the old "desc" field's value of the GroupInfo entity. +// If the GroupInfo object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *GroupInfoMutation) OldDesc(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldDesc is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldDesc requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDesc: %w", err) + } + return oldValue.Desc, nil +} + +// OldMaxUsers returns the old "max_users" field's value of the GroupInfo entity. +// If the GroupInfo object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *GroupInfoMutation) OldMaxUsers(ctx context.Context) (v int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldMaxUsers is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldMaxUsers requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMaxUsers: %w", err) + } + return oldValue.MaxUsers, nil +} + +// 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 *GroupInfoMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case groupinfo.FieldDesc: + return m.OldDesc(ctx) + case groupinfo.FieldMaxUsers: + return m.OldMaxUsers(ctx) + } + return nil, fmt.Errorf("unknown GroupInfo field %s", name) +} + +// ItemMutation represents an operation that mutates the Item nodes in the graph. +type ItemMutation struct { + item.Mutation + config + id *string + done bool + oldValue func(context.Context) (*Item, error) +} + +var _ ent.Mutation = (*ItemMutation)(nil) + +// itemOption allows management of the mutation configuration using functional options. +type itemOption func(*ItemMutation) + +// newItemMutation creates new mutation for the Item entity. +func newItemMutation(c config, op Op, opts ...itemOption) *ItemMutation { + m := &ItemMutation{ + Mutation: *item.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of Item entities. +func (m *ItemMutation) SetID(id string) { + m.id = &id +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *ItemMutation) ID() (id string, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withItemID sets the ID field of the mutation. +func withItemID(id string) itemOption { + return func(m *ItemMutation) { + var ( + err error + once sync.Once + value *Item + ) + m.oldValue = func(ctx context.Context) (*Item, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Item.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withItem sets the old Item of the mutation. +func withItem(node *Item) itemOption { + return func(m *ItemMutation) { + m.oldValue = func(context.Context) (*Item, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m ItemMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m ItemMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *ItemMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().Item.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldText returns the old "text" field's value of the Item entity. +// If the Item object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *ItemMutation) OldText(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldText is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldText requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldText: %w", err) + } + return oldValue.Text, nil +} + +// 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 *ItemMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case item.FieldText: + return m.OldText(ctx) + } + return nil, fmt.Errorf("unknown Item field %s", name) +} + +// LicenseMutation represents an operation that mutates the License nodes in the graph. +type LicenseMutation struct { + license.Mutation + config + id *int + done bool + oldValue func(context.Context) (*License, error) +} + +var _ ent.Mutation = (*LicenseMutation)(nil) + +// licenseOption allows management of the mutation configuration using functional options. +type licenseOption func(*LicenseMutation) + +// newLicenseMutation creates new mutation for the License entity. +func newLicenseMutation(c config, op Op, opts ...licenseOption) *LicenseMutation { + m := &LicenseMutation{ + Mutation: *license.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of License entities. +func (m *LicenseMutation) SetID(id int) { + m.id = &id +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *LicenseMutation) ID() (id int, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withLicenseID sets the ID field of the mutation. +func withLicenseID(id int) licenseOption { + return func(m *LicenseMutation) { + var ( + err error + once sync.Once + value *License + ) + m.oldValue = func(ctx context.Context) (*License, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().License.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withLicense sets the old License of the mutation. +func withLicense(node *License) licenseOption { + return func(m *LicenseMutation) { + m.oldValue = func(context.Context) (*License, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m LicenseMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m LicenseMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *LicenseMutation) IDs(ctx context.Context) ([]int, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []int{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().License.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldCreateTime returns the old "create_time" field's value of the License entity. +// If the License object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *LicenseMutation) OldCreateTime(ctx context.Context) (v time.Time, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldCreateTime is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldCreateTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreateTime: %w", err) + } + return oldValue.CreateTime, nil +} + +// OldUpdateTime returns the old "update_time" field's value of the License entity. +// If the License object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *LicenseMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldUpdateTime is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldUpdateTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdateTime: %w", err) + } + return oldValue.UpdateTime, nil +} + +// 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 *LicenseMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case license.FieldCreateTime: + return m.OldCreateTime(ctx) + case license.FieldUpdateTime: + return m.OldUpdateTime(ctx) + } + return nil, fmt.Errorf("unknown License field %s", name) +} + +// NodeMutation represents an operation that mutates the Node nodes in the graph. +type NodeMutation struct { + node.Mutation + config + id *string + done bool + oldValue func(context.Context) (*Node, error) +} + +var _ ent.Mutation = (*NodeMutation)(nil) + +// nodeOption allows management of the mutation configuration using functional options. +type nodeOption func(*NodeMutation) + +// newNodeMutation creates new mutation for the Node entity. +func newNodeMutation(c config, op Op, opts ...nodeOption) *NodeMutation { + m := &NodeMutation{ + Mutation: *node.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *NodeMutation) ID() (id string, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withNodeID sets the ID field of the mutation. +func withNodeID(id string) nodeOption { + return func(m *NodeMutation) { + var ( + err error + once sync.Once + value *Node + ) + m.oldValue = func(ctx context.Context) (*Node, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Node.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withNode sets the old Node of the mutation. +func withNode(node *Node) nodeOption { + return func(m *NodeMutation) { + m.oldValue = func(context.Context) (*Node, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m NodeMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m NodeMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *NodeMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().Node.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldValue returns the old "value" field's value of the Node entity. +// If the Node object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *NodeMutation) OldValue(ctx context.Context) (v int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldValue is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldValue requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldValue: %w", err) + } + return oldValue.Value, nil +} + +// OldUpdatedAt returns the old "updated_at" field's value of the Node entity. +// If the Node object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *NodeMutation) OldUpdatedAt(ctx context.Context) (v *time.Time, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// 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 *NodeMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case node.FieldValue: + return m.OldValue(ctx) + case node.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + } + return nil, fmt.Errorf("unknown Node field %s", name) +} + +// PCMutation represents an operation that mutates the PC nodes in the graph. +type PCMutation struct { + pc.Mutation + config + id *string + done bool + oldValue func(context.Context) (*PC, error) +} + +var _ ent.Mutation = (*PCMutation)(nil) + +// pcOption allows management of the mutation configuration using functional options. +type pcOption func(*PCMutation) + +// newPCMutation creates new mutation for the PC entity. +func newPCMutation(c config, op Op, opts ...pcOption) *PCMutation { + m := &PCMutation{ + Mutation: *pc.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *PCMutation) ID() (id string, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withPCID sets the ID field of the mutation. +func withPCID(id string) pcOption { + return func(m *PCMutation) { + var ( + err error + once sync.Once + value *PC + ) + m.oldValue = func(ctx context.Context) (*PC, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().PC.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withPC sets the old PC of the mutation. +func withPC(node *PC) pcOption { + return func(m *PCMutation) { + m.oldValue = func(context.Context) (*PC, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m PCMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m PCMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *PCMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().PC.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// 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 *PCMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + return nil, fmt.Errorf("unknown PC field %s", name) +} + +// PetMutation represents an operation that mutates the Pet nodes in the graph. +type PetMutation struct { + pet.Mutation + config + id *string + done bool + oldValue func(context.Context) (*Pet, error) +} + +var _ ent.Mutation = (*PetMutation)(nil) + +// petOption allows management of the mutation configuration using functional options. +type petOption func(*PetMutation) + +// newPetMutation creates new mutation for the Pet entity. +func newPetMutation(c config, op Op, opts ...petOption) *PetMutation { + m := &PetMutation{ + Mutation: *pet.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *PetMutation) ID() (id string, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withPetID sets the ID field of the mutation. +func withPetID(id string) petOption { + return func(m *PetMutation) { + var ( + err error + once sync.Once + value *Pet + ) + m.oldValue = func(ctx context.Context) (*Pet, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Pet.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withPet sets the old Pet of the mutation. +func withPet(node *Pet) petOption { + return func(m *PetMutation) { + m.oldValue = func(context.Context) (*Pet, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m PetMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m PetMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *PetMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().Pet.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldAge returns the old "age" field's value of the Pet entity. +// If the Pet object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *PetMutation) OldAge(ctx context.Context) (v float64, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldAge is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldAge requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAge: %w", err) + } + return oldValue.Age, nil +} + +// OldName returns the old "name" field's value of the Pet entity. +// If the Pet object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *PetMutation) OldName(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// OldUUID returns the old "uuid" field's value of the Pet entity. +// If the Pet object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *PetMutation) OldUUID(ctx context.Context) (v uuid.UUID, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldUUID is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldUUID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUUID: %w", err) + } + return oldValue.UUID, nil +} + +// OldNickname returns the old "nickname" field's value of the Pet entity. +// If the Pet object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *PetMutation) OldNickname(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNickname is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNickname requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNickname: %w", err) + } + return oldValue.Nickname, nil +} + +// OldTrained returns the old "trained" field's value of the Pet entity. +// If the Pet object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *PetMutation) OldTrained(ctx context.Context) (v bool, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldTrained is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldTrained requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTrained: %w", err) + } + return oldValue.Trained, nil +} + +// OldOptionalTime returns the old "optional_time" field's value of the Pet entity. +// If the Pet object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *PetMutation) OldOptionalTime(ctx context.Context) (v time.Time, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalTime is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalTime: %w", err) + } + return oldValue.OptionalTime, nil +} + +// 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 *PetMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case pet.FieldAge: + return m.OldAge(ctx) + case pet.FieldName: + return m.OldName(ctx) + case pet.FieldUUID: + return m.OldUUID(ctx) + case pet.FieldNickname: + return m.OldNickname(ctx) + case pet.FieldTrained: + return m.OldTrained(ctx) + case pet.FieldOptionalTime: + return m.OldOptionalTime(ctx) + } + return nil, fmt.Errorf("unknown Pet field %s", name) +} + +// SpecMutation represents an operation that mutates the Spec nodes in the graph. +type SpecMutation struct { + spec.Mutation + config + id *string + done bool + oldValue func(context.Context) (*Spec, error) +} + +var _ ent.Mutation = (*SpecMutation)(nil) + +// specOption allows management of the mutation configuration using functional options. +type specOption func(*SpecMutation) + +// newSpecMutation creates new mutation for the Spec entity. +func newSpecMutation(c config, op Op, opts ...specOption) *SpecMutation { + m := &SpecMutation{ + Mutation: *spec.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *SpecMutation) ID() (id string, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withSpecID sets the ID field of the mutation. +func withSpecID(id string) specOption { + return func(m *SpecMutation) { + var ( + err error + once sync.Once + value *Spec + ) + m.oldValue = func(ctx context.Context) (*Spec, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Spec.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withSpec sets the old Spec of the mutation. +func withSpec(node *Spec) specOption { + return func(m *SpecMutation) { + m.oldValue = func(context.Context) (*Spec, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m SpecMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m SpecMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *SpecMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().Spec.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// 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 *SpecMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + return nil, fmt.Errorf("unknown Spec field %s", name) +} + +// TaskMutation represents an operation that mutates the Task nodes in the graph. +type TaskMutation struct { + enttask.Mutation + config + id *string + done bool + oldValue func(context.Context) (*Task, error) +} + +var _ ent.Mutation = (*TaskMutation)(nil) + +// taskOption allows management of the mutation configuration using functional options. +type taskOption func(*TaskMutation) + +// newTaskMutation creates new mutation for the Task entity. +func newTaskMutation(c config, op Op, opts ...taskOption) *TaskMutation { + m := &TaskMutation{ + Mutation: *enttask.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *TaskMutation) ID() (id string, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withTaskID sets the ID field of the mutation. +func withTaskID(id string) taskOption { + return func(m *TaskMutation) { + var ( + err error + once sync.Once + value *Task + ) + m.oldValue = func(ctx context.Context) (*Task, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Task.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withTask sets the old Task of the mutation. +func withTask(node *Task) taskOption { + return func(m *TaskMutation) { + m.oldValue = func(context.Context) (*Task, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m TaskMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m TaskMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *TaskMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().Task.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldPriority returns the old "priority" field's value of the Task entity. +// If the Task object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *TaskMutation) OldPriority(ctx context.Context) (v task.Priority, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldPriority is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldPriority requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPriority: %w", err) + } + return oldValue.Priority, nil +} + +// OldPriorities returns the old "priorities" field's value of the Task entity. +// If the Task object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *TaskMutation) OldPriorities(ctx context.Context) (v map[string]task.Priority, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldPriorities is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldPriorities requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPriorities: %w", err) + } + return oldValue.Priorities, nil +} + +// OldCreatedAt returns the old "created_at" field's value of the Task entity. +// If the Task object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *TaskMutation) OldCreatedAt(ctx context.Context) (v *time.Time, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// OldName returns the old "name" field's value of the Task entity. +// If the Task object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *TaskMutation) OldName(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// OldOwner returns the old "owner" field's value of the Task entity. +// If the Task object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *TaskMutation) OldOwner(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOwner is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOwner requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwner: %w", err) + } + return oldValue.Owner, nil +} + +// OldOrder returns the old "order" field's value of the Task entity. +// If the Task object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *TaskMutation) OldOrder(ctx context.Context) (v int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOrder is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOrder requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOrder: %w", err) + } + return oldValue.Order, nil +} + +// OldOrderOption returns the old "order_option" field's value of the Task entity. +// If the Task object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *TaskMutation) OldOrderOption(ctx context.Context) (v int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOrderOption is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOrderOption requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOrderOption: %w", err) + } + return oldValue.OrderOption, nil +} + +// OldOp returns the old "op" field's value of the Task entity. +// If the Task object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *TaskMutation) OldOp(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOp is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOp requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOp: %w", err) + } + return oldValue.Op, nil +} + +// 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 *TaskMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case enttask.FieldPriority: + return m.OldPriority(ctx) + case enttask.FieldPriorities: + return m.OldPriorities(ctx) + case enttask.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case enttask.FieldName: + return m.OldName(ctx) + case enttask.FieldOwner: + return m.OldOwner(ctx) + case enttask.FieldOrder: + return m.OldOrder(ctx) + case enttask.FieldOrderOption: + return m.OldOrderOption(ctx) + case enttask.FieldOp: + return m.OldOp(ctx) + } + return nil, fmt.Errorf("unknown Task field %s", name) +} + +// UserMutation represents an operation that mutates the User nodes in the graph. +type UserMutation struct { + user.Mutation + config + id *string + done bool + oldValue func(context.Context) (*User, error) +} + +var _ ent.Mutation = (*UserMutation)(nil) + +// userOption allows management of the mutation configuration using functional options. +type userOption func(*UserMutation) + +// newUserMutation creates new mutation for the User entity. +func newUserMutation(c config, op Op, opts ...userOption) *UserMutation { + m := &UserMutation{ + Mutation: *user.NewMutation(op), + config: c, + } + for _, opt := range opts { + opt(m) + } + return m +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *UserMutation) ID() (id string, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// withUserID sets the ID field of the mutation. +func withUserID(id string) userOption { + return func(m *UserMutation) { + var ( + err error + once sync.Once + value *User + ) + m.oldValue = func(ctx context.Context) (*User, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().User.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withUser sets the old User of the mutation. +func withUser(node *User) userOption { + return func(m *UserMutation) { + m.oldValue = func(context.Context) (*User, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m UserMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m UserMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *UserMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.Op().Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.Op().Is(OpUpdate | OpDelete): + return m.Client().User.Query().Where(m.Predicates()...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.Op()) + } +} + +// OldOptionalInt returns the old "optional_int" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldOptionalInt(ctx context.Context) (v int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldOptionalInt is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldOptionalInt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOptionalInt: %w", err) + } + return oldValue.OptionalInt, nil +} + +// OldAge returns the old "age" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldAge(ctx context.Context) (v int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldAge is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldAge requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAge: %w", err) + } + return oldValue.Age, nil +} + +// OldName returns the old "name" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldName(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// OldLast returns the old "last" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldLast(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldLast is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldLast requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLast: %w", err) + } + return oldValue.Last, nil +} + +// OldNickname returns the old "nickname" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldNickname(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldNickname is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldNickname requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNickname: %w", err) + } + return oldValue.Nickname, nil +} + +// OldAddress returns the old "address" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldAddress(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldAddress is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldAddress requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAddress: %w", err) + } + return oldValue.Address, nil +} + +// OldPhone returns the old "phone" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldPhone(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldPhone is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldPhone requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPhone: %w", err) + } + return oldValue.Phone, nil +} + +// OldPassword returns the old "password" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldPassword is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldPassword requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPassword: %w", err) + } + return oldValue.Password, nil +} + +// OldRole returns the old "role" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldRole(ctx context.Context) (v user.Role, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldRole is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldRole requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRole: %w", err) + } + return oldValue.Role, nil +} + +// OldEmployment returns the old "employment" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldEmployment(ctx context.Context) (v user.Employment, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldEmployment is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldEmployment requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldEmployment: %w", err) + } + return oldValue.Employment, nil +} + +// OldSSOCert returns the old "SSOCert" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldSSOCert(ctx context.Context) (v string, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldSSOCert is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldSSOCert requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSSOCert: %w", err) + } + return oldValue.SSOCert, nil +} + +// OldFilesCount returns the old "files_count" field's value of the User entity. +// If the User object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *UserMutation) OldFilesCount(ctx context.Context) (v int, err error) { + if !m.Op().Is(OpUpdateOne) { + return v, errors.New("OldFilesCount is only allowed on UpdateOne operations") + } + if _, exists := m.ID(); !exists || m.oldValue == nil { + return v, errors.New("OldFilesCount requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldFilesCount: %w", err) + } + return oldValue.FilesCount, nil +} + +// 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 *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case user.FieldOptionalInt: + return m.OldOptionalInt(ctx) + case user.FieldAge: + return m.OldAge(ctx) + case user.FieldName: + return m.OldName(ctx) + case user.FieldLast: + return m.OldLast(ctx) + case user.FieldNickname: + return m.OldNickname(ctx) + case user.FieldAddress: + return m.OldAddress(ctx) + case user.FieldPhone: + return m.OldPhone(ctx) + case user.FieldPassword: + return m.OldPassword(ctx) + case user.FieldRole: + return m.OldRole(ctx) + case user.FieldEmployment: + return m.OldEmployment(ctx) + case user.FieldSSOCert: + return m.OldSSOCert(ctx) + case user.FieldFilesCount: + return m.OldFilesCount(ctx) + } + return nil, fmt.Errorf("unknown User field %s", name) +}