snapshot of https://github.com/ent/ent.git (master, 2026-09-15; blobs > 131072B omitted)
This commit is contained in:
339
examples/migration/ent/session/where.go
Normal file
339
examples/migration/ent/session/where.go
Normal file
@@ -0,0 +1,339 @@
|
||||
// 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 session
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
"entgo.io/ent/examples/migration/ent/predicate"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
// ID filters vertices based on their ID field.
|
||||
func ID(id uuid.UUID) predicate.Session {
|
||||
return predicate.Session(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDEQ applies the EQ predicate on the ID field.
|
||||
func IDEQ(id uuid.UUID) predicate.Session {
|
||||
return predicate.Session(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDNEQ applies the NEQ predicate on the ID field.
|
||||
func IDNEQ(id uuid.UUID) predicate.Session {
|
||||
return predicate.Session(sql.FieldNEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDIn applies the In predicate on the ID field.
|
||||
func IDIn(ids ...uuid.UUID) predicate.Session {
|
||||
return predicate.Session(sql.FieldIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDNotIn applies the NotIn predicate on the ID field.
|
||||
func IDNotIn(ids ...uuid.UUID) predicate.Session {
|
||||
return predicate.Session(sql.FieldNotIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDGT applies the GT predicate on the ID field.
|
||||
func IDGT(id uuid.UUID) predicate.Session {
|
||||
return predicate.Session(sql.FieldGT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDGTE applies the GTE predicate on the ID field.
|
||||
func IDGTE(id uuid.UUID) predicate.Session {
|
||||
return predicate.Session(sql.FieldGTE(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLT applies the LT predicate on the ID field.
|
||||
func IDLT(id uuid.UUID) predicate.Session {
|
||||
return predicate.Session(sql.FieldLT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLTE applies the LTE predicate on the ID field.
|
||||
func IDLTE(id uuid.UUID) predicate.Session {
|
||||
return predicate.Session(sql.FieldLTE(FieldID, id))
|
||||
}
|
||||
|
||||
// Active applies equality check predicate on the "active" field. It's identical to ActiveEQ.
|
||||
func Active(v bool) predicate.Session {
|
||||
return predicate.Session(sql.FieldEQ(FieldActive, v))
|
||||
}
|
||||
|
||||
// IssuedAt applies equality check predicate on the "issued_at" field. It's identical to IssuedAtEQ.
|
||||
func IssuedAt(v time.Time) predicate.Session {
|
||||
return predicate.Session(sql.FieldEQ(FieldIssuedAt, v))
|
||||
}
|
||||
|
||||
// ExpiresAt applies equality check predicate on the "expires_at" field. It's identical to ExpiresAtEQ.
|
||||
func ExpiresAt(v time.Time) predicate.Session {
|
||||
return predicate.Session(sql.FieldEQ(FieldExpiresAt, v))
|
||||
}
|
||||
|
||||
// Token applies equality check predicate on the "token" field. It's identical to TokenEQ.
|
||||
func Token(v string) predicate.Session {
|
||||
return predicate.Session(sql.FieldEQ(FieldToken, v))
|
||||
}
|
||||
|
||||
// DeviceID applies equality check predicate on the "device_id" field. It's identical to DeviceIDEQ.
|
||||
func DeviceID(v uuid.UUID) predicate.Session {
|
||||
return predicate.Session(sql.FieldEQ(FieldDeviceID, v))
|
||||
}
|
||||
|
||||
// ActiveEQ applies the EQ predicate on the "active" field.
|
||||
func ActiveEQ(v bool) predicate.Session {
|
||||
return predicate.Session(sql.FieldEQ(FieldActive, v))
|
||||
}
|
||||
|
||||
// ActiveNEQ applies the NEQ predicate on the "active" field.
|
||||
func ActiveNEQ(v bool) predicate.Session {
|
||||
return predicate.Session(sql.FieldNEQ(FieldActive, v))
|
||||
}
|
||||
|
||||
// IssuedAtEQ applies the EQ predicate on the "issued_at" field.
|
||||
func IssuedAtEQ(v time.Time) predicate.Session {
|
||||
return predicate.Session(sql.FieldEQ(FieldIssuedAt, v))
|
||||
}
|
||||
|
||||
// IssuedAtNEQ applies the NEQ predicate on the "issued_at" field.
|
||||
func IssuedAtNEQ(v time.Time) predicate.Session {
|
||||
return predicate.Session(sql.FieldNEQ(FieldIssuedAt, v))
|
||||
}
|
||||
|
||||
// IssuedAtIn applies the In predicate on the "issued_at" field.
|
||||
func IssuedAtIn(vs ...time.Time) predicate.Session {
|
||||
return predicate.Session(sql.FieldIn(FieldIssuedAt, vs...))
|
||||
}
|
||||
|
||||
// IssuedAtNotIn applies the NotIn predicate on the "issued_at" field.
|
||||
func IssuedAtNotIn(vs ...time.Time) predicate.Session {
|
||||
return predicate.Session(sql.FieldNotIn(FieldIssuedAt, vs...))
|
||||
}
|
||||
|
||||
// IssuedAtGT applies the GT predicate on the "issued_at" field.
|
||||
func IssuedAtGT(v time.Time) predicate.Session {
|
||||
return predicate.Session(sql.FieldGT(FieldIssuedAt, v))
|
||||
}
|
||||
|
||||
// IssuedAtGTE applies the GTE predicate on the "issued_at" field.
|
||||
func IssuedAtGTE(v time.Time) predicate.Session {
|
||||
return predicate.Session(sql.FieldGTE(FieldIssuedAt, v))
|
||||
}
|
||||
|
||||
// IssuedAtLT applies the LT predicate on the "issued_at" field.
|
||||
func IssuedAtLT(v time.Time) predicate.Session {
|
||||
return predicate.Session(sql.FieldLT(FieldIssuedAt, v))
|
||||
}
|
||||
|
||||
// IssuedAtLTE applies the LTE predicate on the "issued_at" field.
|
||||
func IssuedAtLTE(v time.Time) predicate.Session {
|
||||
return predicate.Session(sql.FieldLTE(FieldIssuedAt, v))
|
||||
}
|
||||
|
||||
// ExpiresAtEQ applies the EQ predicate on the "expires_at" field.
|
||||
func ExpiresAtEQ(v time.Time) predicate.Session {
|
||||
return predicate.Session(sql.FieldEQ(FieldExpiresAt, v))
|
||||
}
|
||||
|
||||
// ExpiresAtNEQ applies the NEQ predicate on the "expires_at" field.
|
||||
func ExpiresAtNEQ(v time.Time) predicate.Session {
|
||||
return predicate.Session(sql.FieldNEQ(FieldExpiresAt, v))
|
||||
}
|
||||
|
||||
// ExpiresAtIn applies the In predicate on the "expires_at" field.
|
||||
func ExpiresAtIn(vs ...time.Time) predicate.Session {
|
||||
return predicate.Session(sql.FieldIn(FieldExpiresAt, vs...))
|
||||
}
|
||||
|
||||
// ExpiresAtNotIn applies the NotIn predicate on the "expires_at" field.
|
||||
func ExpiresAtNotIn(vs ...time.Time) predicate.Session {
|
||||
return predicate.Session(sql.FieldNotIn(FieldExpiresAt, vs...))
|
||||
}
|
||||
|
||||
// ExpiresAtGT applies the GT predicate on the "expires_at" field.
|
||||
func ExpiresAtGT(v time.Time) predicate.Session {
|
||||
return predicate.Session(sql.FieldGT(FieldExpiresAt, v))
|
||||
}
|
||||
|
||||
// ExpiresAtGTE applies the GTE predicate on the "expires_at" field.
|
||||
func ExpiresAtGTE(v time.Time) predicate.Session {
|
||||
return predicate.Session(sql.FieldGTE(FieldExpiresAt, v))
|
||||
}
|
||||
|
||||
// ExpiresAtLT applies the LT predicate on the "expires_at" field.
|
||||
func ExpiresAtLT(v time.Time) predicate.Session {
|
||||
return predicate.Session(sql.FieldLT(FieldExpiresAt, v))
|
||||
}
|
||||
|
||||
// ExpiresAtLTE applies the LTE predicate on the "expires_at" field.
|
||||
func ExpiresAtLTE(v time.Time) predicate.Session {
|
||||
return predicate.Session(sql.FieldLTE(FieldExpiresAt, v))
|
||||
}
|
||||
|
||||
// ExpiresAtIsNil applies the IsNil predicate on the "expires_at" field.
|
||||
func ExpiresAtIsNil() predicate.Session {
|
||||
return predicate.Session(sql.FieldIsNull(FieldExpiresAt))
|
||||
}
|
||||
|
||||
// ExpiresAtNotNil applies the NotNil predicate on the "expires_at" field.
|
||||
func ExpiresAtNotNil() predicate.Session {
|
||||
return predicate.Session(sql.FieldNotNull(FieldExpiresAt))
|
||||
}
|
||||
|
||||
// TokenEQ applies the EQ predicate on the "token" field.
|
||||
func TokenEQ(v string) predicate.Session {
|
||||
return predicate.Session(sql.FieldEQ(FieldToken, v))
|
||||
}
|
||||
|
||||
// TokenNEQ applies the NEQ predicate on the "token" field.
|
||||
func TokenNEQ(v string) predicate.Session {
|
||||
return predicate.Session(sql.FieldNEQ(FieldToken, v))
|
||||
}
|
||||
|
||||
// TokenIn applies the In predicate on the "token" field.
|
||||
func TokenIn(vs ...string) predicate.Session {
|
||||
return predicate.Session(sql.FieldIn(FieldToken, vs...))
|
||||
}
|
||||
|
||||
// TokenNotIn applies the NotIn predicate on the "token" field.
|
||||
func TokenNotIn(vs ...string) predicate.Session {
|
||||
return predicate.Session(sql.FieldNotIn(FieldToken, vs...))
|
||||
}
|
||||
|
||||
// TokenGT applies the GT predicate on the "token" field.
|
||||
func TokenGT(v string) predicate.Session {
|
||||
return predicate.Session(sql.FieldGT(FieldToken, v))
|
||||
}
|
||||
|
||||
// TokenGTE applies the GTE predicate on the "token" field.
|
||||
func TokenGTE(v string) predicate.Session {
|
||||
return predicate.Session(sql.FieldGTE(FieldToken, v))
|
||||
}
|
||||
|
||||
// TokenLT applies the LT predicate on the "token" field.
|
||||
func TokenLT(v string) predicate.Session {
|
||||
return predicate.Session(sql.FieldLT(FieldToken, v))
|
||||
}
|
||||
|
||||
// TokenLTE applies the LTE predicate on the "token" field.
|
||||
func TokenLTE(v string) predicate.Session {
|
||||
return predicate.Session(sql.FieldLTE(FieldToken, v))
|
||||
}
|
||||
|
||||
// TokenContains applies the Contains predicate on the "token" field.
|
||||
func TokenContains(v string) predicate.Session {
|
||||
return predicate.Session(sql.FieldContains(FieldToken, v))
|
||||
}
|
||||
|
||||
// TokenHasPrefix applies the HasPrefix predicate on the "token" field.
|
||||
func TokenHasPrefix(v string) predicate.Session {
|
||||
return predicate.Session(sql.FieldHasPrefix(FieldToken, v))
|
||||
}
|
||||
|
||||
// TokenHasSuffix applies the HasSuffix predicate on the "token" field.
|
||||
func TokenHasSuffix(v string) predicate.Session {
|
||||
return predicate.Session(sql.FieldHasSuffix(FieldToken, v))
|
||||
}
|
||||
|
||||
// TokenIsNil applies the IsNil predicate on the "token" field.
|
||||
func TokenIsNil() predicate.Session {
|
||||
return predicate.Session(sql.FieldIsNull(FieldToken))
|
||||
}
|
||||
|
||||
// TokenNotNil applies the NotNil predicate on the "token" field.
|
||||
func TokenNotNil() predicate.Session {
|
||||
return predicate.Session(sql.FieldNotNull(FieldToken))
|
||||
}
|
||||
|
||||
// TokenEqualFold applies the EqualFold predicate on the "token" field.
|
||||
func TokenEqualFold(v string) predicate.Session {
|
||||
return predicate.Session(sql.FieldEqualFold(FieldToken, v))
|
||||
}
|
||||
|
||||
// TokenContainsFold applies the ContainsFold predicate on the "token" field.
|
||||
func TokenContainsFold(v string) predicate.Session {
|
||||
return predicate.Session(sql.FieldContainsFold(FieldToken, v))
|
||||
}
|
||||
|
||||
// MethodIsNil applies the IsNil predicate on the "method" field.
|
||||
func MethodIsNil() predicate.Session {
|
||||
return predicate.Session(sql.FieldIsNull(FieldMethod))
|
||||
}
|
||||
|
||||
// MethodNotNil applies the NotNil predicate on the "method" field.
|
||||
func MethodNotNil() predicate.Session {
|
||||
return predicate.Session(sql.FieldNotNull(FieldMethod))
|
||||
}
|
||||
|
||||
// DeviceIDEQ applies the EQ predicate on the "device_id" field.
|
||||
func DeviceIDEQ(v uuid.UUID) predicate.Session {
|
||||
return predicate.Session(sql.FieldEQ(FieldDeviceID, v))
|
||||
}
|
||||
|
||||
// DeviceIDNEQ applies the NEQ predicate on the "device_id" field.
|
||||
func DeviceIDNEQ(v uuid.UUID) predicate.Session {
|
||||
return predicate.Session(sql.FieldNEQ(FieldDeviceID, v))
|
||||
}
|
||||
|
||||
// DeviceIDIn applies the In predicate on the "device_id" field.
|
||||
func DeviceIDIn(vs ...uuid.UUID) predicate.Session {
|
||||
return predicate.Session(sql.FieldIn(FieldDeviceID, vs...))
|
||||
}
|
||||
|
||||
// DeviceIDNotIn applies the NotIn predicate on the "device_id" field.
|
||||
func DeviceIDNotIn(vs ...uuid.UUID) predicate.Session {
|
||||
return predicate.Session(sql.FieldNotIn(FieldDeviceID, vs...))
|
||||
}
|
||||
|
||||
// DeviceIDIsNil applies the IsNil predicate on the "device_id" field.
|
||||
func DeviceIDIsNil() predicate.Session {
|
||||
return predicate.Session(sql.FieldIsNull(FieldDeviceID))
|
||||
}
|
||||
|
||||
// DeviceIDNotNil applies the NotNil predicate on the "device_id" field.
|
||||
func DeviceIDNotNil() predicate.Session {
|
||||
return predicate.Session(sql.FieldNotNull(FieldDeviceID))
|
||||
}
|
||||
|
||||
// HasDevice applies the HasEdge predicate on the "device" edge.
|
||||
func HasDevice() predicate.Session {
|
||||
return predicate.Session(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, DeviceTable, DeviceColumn),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
})
|
||||
}
|
||||
|
||||
// HasDeviceWith applies the HasEdge predicate on the "device" edge with a given conditions (other predicates).
|
||||
func HasDeviceWith(preds ...predicate.SessionDevice) predicate.Session {
|
||||
return predicate.Session(func(s *sql.Selector) {
|
||||
step := newDeviceStep()
|
||||
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
||||
for _, p := range preds {
|
||||
p(s)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// And groups predicates with the AND operator between them.
|
||||
func And(predicates ...predicate.Session) predicate.Session {
|
||||
return predicate.Session(sql.AndPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Or groups predicates with the OR operator between them.
|
||||
func Or(predicates ...predicate.Session) predicate.Session {
|
||||
return predicate.Session(sql.OrPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Not applies the not operator on the given predicate.
|
||||
func Not(p predicate.Session) predicate.Session {
|
||||
return predicate.Session(sql.NotPredicates(p))
|
||||
}
|
||||
Reference in New Issue
Block a user