snapshot of https://github.com/ent/ent.git (master, 2026-09-15; blobs > 131072B omitted)
This commit is contained in:
409
examples/migration/ent/sessiondevice/where.go
Normal file
409
examples/migration/ent/sessiondevice/where.go
Normal file
@@ -0,0 +1,409 @@
|
||||
// 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 sessiondevice
|
||||
|
||||
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.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDEQ applies the EQ predicate on the ID field.
|
||||
func IDEQ(id uuid.UUID) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDNEQ applies the NEQ predicate on the ID field.
|
||||
func IDNEQ(id uuid.UUID) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldNEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDIn applies the In predicate on the ID field.
|
||||
func IDIn(ids ...uuid.UUID) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDNotIn applies the NotIn predicate on the ID field.
|
||||
func IDNotIn(ids ...uuid.UUID) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldNotIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDGT applies the GT predicate on the ID field.
|
||||
func IDGT(id uuid.UUID) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldGT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDGTE applies the GTE predicate on the ID field.
|
||||
func IDGTE(id uuid.UUID) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldGTE(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLT applies the LT predicate on the ID field.
|
||||
func IDLT(id uuid.UUID) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldLT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLTE applies the LTE predicate on the ID field.
|
||||
func IDLTE(id uuid.UUID) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldLTE(FieldID, id))
|
||||
}
|
||||
|
||||
// IPAddress applies equality check predicate on the "ip_address" field. It's identical to IPAddressEQ.
|
||||
func IPAddress(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldEQ(FieldIPAddress, v))
|
||||
}
|
||||
|
||||
// UserAgent applies equality check predicate on the "user_agent" field. It's identical to UserAgentEQ.
|
||||
func UserAgent(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldEQ(FieldUserAgent, v))
|
||||
}
|
||||
|
||||
// Location applies equality check predicate on the "location" field. It's identical to LocationEQ.
|
||||
func Location(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldEQ(FieldLocation, v))
|
||||
}
|
||||
|
||||
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
|
||||
func CreatedAt(v time.Time) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.
|
||||
func UpdatedAt(v time.Time) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldEQ(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// IPAddressEQ applies the EQ predicate on the "ip_address" field.
|
||||
func IPAddressEQ(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldEQ(FieldIPAddress, v))
|
||||
}
|
||||
|
||||
// IPAddressNEQ applies the NEQ predicate on the "ip_address" field.
|
||||
func IPAddressNEQ(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldNEQ(FieldIPAddress, v))
|
||||
}
|
||||
|
||||
// IPAddressIn applies the In predicate on the "ip_address" field.
|
||||
func IPAddressIn(vs ...string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldIn(FieldIPAddress, vs...))
|
||||
}
|
||||
|
||||
// IPAddressNotIn applies the NotIn predicate on the "ip_address" field.
|
||||
func IPAddressNotIn(vs ...string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldNotIn(FieldIPAddress, vs...))
|
||||
}
|
||||
|
||||
// IPAddressGT applies the GT predicate on the "ip_address" field.
|
||||
func IPAddressGT(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldGT(FieldIPAddress, v))
|
||||
}
|
||||
|
||||
// IPAddressGTE applies the GTE predicate on the "ip_address" field.
|
||||
func IPAddressGTE(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldGTE(FieldIPAddress, v))
|
||||
}
|
||||
|
||||
// IPAddressLT applies the LT predicate on the "ip_address" field.
|
||||
func IPAddressLT(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldLT(FieldIPAddress, v))
|
||||
}
|
||||
|
||||
// IPAddressLTE applies the LTE predicate on the "ip_address" field.
|
||||
func IPAddressLTE(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldLTE(FieldIPAddress, v))
|
||||
}
|
||||
|
||||
// IPAddressContains applies the Contains predicate on the "ip_address" field.
|
||||
func IPAddressContains(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldContains(FieldIPAddress, v))
|
||||
}
|
||||
|
||||
// IPAddressHasPrefix applies the HasPrefix predicate on the "ip_address" field.
|
||||
func IPAddressHasPrefix(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldHasPrefix(FieldIPAddress, v))
|
||||
}
|
||||
|
||||
// IPAddressHasSuffix applies the HasSuffix predicate on the "ip_address" field.
|
||||
func IPAddressHasSuffix(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldHasSuffix(FieldIPAddress, v))
|
||||
}
|
||||
|
||||
// IPAddressEqualFold applies the EqualFold predicate on the "ip_address" field.
|
||||
func IPAddressEqualFold(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldEqualFold(FieldIPAddress, v))
|
||||
}
|
||||
|
||||
// IPAddressContainsFold applies the ContainsFold predicate on the "ip_address" field.
|
||||
func IPAddressContainsFold(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldContainsFold(FieldIPAddress, v))
|
||||
}
|
||||
|
||||
// UserAgentEQ applies the EQ predicate on the "user_agent" field.
|
||||
func UserAgentEQ(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldEQ(FieldUserAgent, v))
|
||||
}
|
||||
|
||||
// UserAgentNEQ applies the NEQ predicate on the "user_agent" field.
|
||||
func UserAgentNEQ(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldNEQ(FieldUserAgent, v))
|
||||
}
|
||||
|
||||
// UserAgentIn applies the In predicate on the "user_agent" field.
|
||||
func UserAgentIn(vs ...string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldIn(FieldUserAgent, vs...))
|
||||
}
|
||||
|
||||
// UserAgentNotIn applies the NotIn predicate on the "user_agent" field.
|
||||
func UserAgentNotIn(vs ...string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldNotIn(FieldUserAgent, vs...))
|
||||
}
|
||||
|
||||
// UserAgentGT applies the GT predicate on the "user_agent" field.
|
||||
func UserAgentGT(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldGT(FieldUserAgent, v))
|
||||
}
|
||||
|
||||
// UserAgentGTE applies the GTE predicate on the "user_agent" field.
|
||||
func UserAgentGTE(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldGTE(FieldUserAgent, v))
|
||||
}
|
||||
|
||||
// UserAgentLT applies the LT predicate on the "user_agent" field.
|
||||
func UserAgentLT(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldLT(FieldUserAgent, v))
|
||||
}
|
||||
|
||||
// UserAgentLTE applies the LTE predicate on the "user_agent" field.
|
||||
func UserAgentLTE(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldLTE(FieldUserAgent, v))
|
||||
}
|
||||
|
||||
// UserAgentContains applies the Contains predicate on the "user_agent" field.
|
||||
func UserAgentContains(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldContains(FieldUserAgent, v))
|
||||
}
|
||||
|
||||
// UserAgentHasPrefix applies the HasPrefix predicate on the "user_agent" field.
|
||||
func UserAgentHasPrefix(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldHasPrefix(FieldUserAgent, v))
|
||||
}
|
||||
|
||||
// UserAgentHasSuffix applies the HasSuffix predicate on the "user_agent" field.
|
||||
func UserAgentHasSuffix(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldHasSuffix(FieldUserAgent, v))
|
||||
}
|
||||
|
||||
// UserAgentEqualFold applies the EqualFold predicate on the "user_agent" field.
|
||||
func UserAgentEqualFold(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldEqualFold(FieldUserAgent, v))
|
||||
}
|
||||
|
||||
// UserAgentContainsFold applies the ContainsFold predicate on the "user_agent" field.
|
||||
func UserAgentContainsFold(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldContainsFold(FieldUserAgent, v))
|
||||
}
|
||||
|
||||
// LocationEQ applies the EQ predicate on the "location" field.
|
||||
func LocationEQ(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldEQ(FieldLocation, v))
|
||||
}
|
||||
|
||||
// LocationNEQ applies the NEQ predicate on the "location" field.
|
||||
func LocationNEQ(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldNEQ(FieldLocation, v))
|
||||
}
|
||||
|
||||
// LocationIn applies the In predicate on the "location" field.
|
||||
func LocationIn(vs ...string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldIn(FieldLocation, vs...))
|
||||
}
|
||||
|
||||
// LocationNotIn applies the NotIn predicate on the "location" field.
|
||||
func LocationNotIn(vs ...string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldNotIn(FieldLocation, vs...))
|
||||
}
|
||||
|
||||
// LocationGT applies the GT predicate on the "location" field.
|
||||
func LocationGT(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldGT(FieldLocation, v))
|
||||
}
|
||||
|
||||
// LocationGTE applies the GTE predicate on the "location" field.
|
||||
func LocationGTE(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldGTE(FieldLocation, v))
|
||||
}
|
||||
|
||||
// LocationLT applies the LT predicate on the "location" field.
|
||||
func LocationLT(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldLT(FieldLocation, v))
|
||||
}
|
||||
|
||||
// LocationLTE applies the LTE predicate on the "location" field.
|
||||
func LocationLTE(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldLTE(FieldLocation, v))
|
||||
}
|
||||
|
||||
// LocationContains applies the Contains predicate on the "location" field.
|
||||
func LocationContains(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldContains(FieldLocation, v))
|
||||
}
|
||||
|
||||
// LocationHasPrefix applies the HasPrefix predicate on the "location" field.
|
||||
func LocationHasPrefix(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldHasPrefix(FieldLocation, v))
|
||||
}
|
||||
|
||||
// LocationHasSuffix applies the HasSuffix predicate on the "location" field.
|
||||
func LocationHasSuffix(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldHasSuffix(FieldLocation, v))
|
||||
}
|
||||
|
||||
// LocationEqualFold applies the EqualFold predicate on the "location" field.
|
||||
func LocationEqualFold(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldEqualFold(FieldLocation, v))
|
||||
}
|
||||
|
||||
// LocationContainsFold applies the ContainsFold predicate on the "location" field.
|
||||
func LocationContainsFold(v string) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldContainsFold(FieldLocation, v))
|
||||
}
|
||||
|
||||
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
|
||||
func CreatedAtEQ(v time.Time) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
|
||||
func CreatedAtNEQ(v time.Time) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldNEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtIn applies the In predicate on the "created_at" field.
|
||||
func CreatedAtIn(vs ...time.Time) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldIn(FieldCreatedAt, vs...))
|
||||
}
|
||||
|
||||
// CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
|
||||
func CreatedAtNotIn(vs ...time.Time) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldNotIn(FieldCreatedAt, vs...))
|
||||
}
|
||||
|
||||
// CreatedAtGT applies the GT predicate on the "created_at" field.
|
||||
func CreatedAtGT(v time.Time) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldGT(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtGTE applies the GTE predicate on the "created_at" field.
|
||||
func CreatedAtGTE(v time.Time) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldGTE(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtLT applies the LT predicate on the "created_at" field.
|
||||
func CreatedAtLT(v time.Time) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldLT(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtLTE applies the LTE predicate on the "created_at" field.
|
||||
func CreatedAtLTE(v time.Time) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldLTE(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtEQ applies the EQ predicate on the "updated_at" field.
|
||||
func UpdatedAtEQ(v time.Time) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldEQ(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.
|
||||
func UpdatedAtNEQ(v time.Time) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldNEQ(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtIn applies the In predicate on the "updated_at" field.
|
||||
func UpdatedAtIn(vs ...time.Time) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldIn(FieldUpdatedAt, vs...))
|
||||
}
|
||||
|
||||
// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.
|
||||
func UpdatedAtNotIn(vs ...time.Time) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldNotIn(FieldUpdatedAt, vs...))
|
||||
}
|
||||
|
||||
// UpdatedAtGT applies the GT predicate on the "updated_at" field.
|
||||
func UpdatedAtGT(v time.Time) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldGT(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtGTE applies the GTE predicate on the "updated_at" field.
|
||||
func UpdatedAtGTE(v time.Time) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldGTE(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtLT applies the LT predicate on the "updated_at" field.
|
||||
func UpdatedAtLT(v time.Time) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldLT(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtLTE applies the LTE predicate on the "updated_at" field.
|
||||
func UpdatedAtLTE(v time.Time) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldLTE(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field.
|
||||
func UpdatedAtIsNil() predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldIsNull(FieldUpdatedAt))
|
||||
}
|
||||
|
||||
// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field.
|
||||
func UpdatedAtNotNil() predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.FieldNotNull(FieldUpdatedAt))
|
||||
}
|
||||
|
||||
// HasSessions applies the HasEdge predicate on the "sessions" edge.
|
||||
func HasSessions() predicate.SessionDevice {
|
||||
return predicate.SessionDevice(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.O2M, false, SessionsTable, SessionsColumn),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
})
|
||||
}
|
||||
|
||||
// HasSessionsWith applies the HasEdge predicate on the "sessions" edge with a given conditions (other predicates).
|
||||
func HasSessionsWith(preds ...predicate.Session) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(func(s *sql.Selector) {
|
||||
step := newSessionsStep()
|
||||
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.SessionDevice) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.AndPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Or groups predicates with the OR operator between them.
|
||||
func Or(predicates ...predicate.SessionDevice) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.OrPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Not applies the not operator on the given predicate.
|
||||
func Not(p predicate.SessionDevice) predicate.SessionDevice {
|
||||
return predicate.SessionDevice(sql.NotPredicates(p))
|
||||
}
|
||||
Reference in New Issue
Block a user