first gen
This commit is contained in:
79
ent/card/card.go
Normal file
79
ent/card/card.go
Normal file
@ -0,0 +1,79 @@
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package card
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
// Label holds the string label denoting the card type in the database.
|
||||
Label = "card"
|
||||
// FieldID holds the string denoting the id field in the database.
|
||||
FieldID = "id"
|
||||
// FieldCard holds the string denoting the card field in the database.
|
||||
FieldCard = "card"
|
||||
// FieldStatus holds the string denoting the status field in the database.
|
||||
FieldStatus = "status"
|
||||
// FieldCp holds the string denoting the cp field in the database.
|
||||
FieldCp = "cp"
|
||||
// FieldURL holds the string denoting the url field in the database.
|
||||
FieldURL = "url"
|
||||
// FieldCreatedAt holds the string denoting the created_at field in the database.
|
||||
FieldCreatedAt = "created_at"
|
||||
// EdgeOwner holds the string denoting the owner edge name in mutations.
|
||||
EdgeOwner = "owner"
|
||||
// Table holds the table name of the card in the database.
|
||||
Table = "cards"
|
||||
// OwnerTable is the table that holds the owner relation/edge.
|
||||
OwnerTable = "cards"
|
||||
// OwnerInverseTable is the table name for the User entity.
|
||||
// It exists in this package in order to avoid circular dependency with the "user" package.
|
||||
OwnerInverseTable = "users"
|
||||
// OwnerColumn is the table column denoting the owner relation/edge.
|
||||
OwnerColumn = "user_card"
|
||||
)
|
||||
|
||||
// Columns holds all SQL columns for card fields.
|
||||
var Columns = []string{
|
||||
FieldID,
|
||||
FieldCard,
|
||||
FieldStatus,
|
||||
FieldCp,
|
||||
FieldURL,
|
||||
FieldCreatedAt,
|
||||
}
|
||||
|
||||
// ForeignKeys holds the SQL foreign-keys that are owned by the "cards"
|
||||
// table and are not defined as standalone fields in the schema.
|
||||
var ForeignKeys = []string{
|
||||
"user_card",
|
||||
}
|
||||
|
||||
// ValidColumn reports if the column name is valid (part of the table columns).
|
||||
func ValidColumn(column string) bool {
|
||||
for i := range Columns {
|
||||
if column == Columns[i] {
|
||||
return true
|
||||
}
|
||||
}
|
||||
for i := range ForeignKeys {
|
||||
if column == ForeignKeys[i] {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var (
|
||||
// DefaultCard holds the default value on creation for the "card" field.
|
||||
DefaultCard func() int
|
||||
// DefaultStatus holds the default value on creation for the "status" field.
|
||||
DefaultStatus func() string
|
||||
// DefaultCp holds the default value on creation for the "cp" field.
|
||||
DefaultCp func() int
|
||||
// DefaultURL holds the default value on creation for the "url" field.
|
||||
DefaultURL string
|
||||
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
|
||||
DefaultCreatedAt func() time.Time
|
||||
)
|
440
ent/card/where.go
Normal file
440
ent/card/where.go
Normal file
@ -0,0 +1,440 @@
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package card
|
||||
|
||||
import (
|
||||
"t/ent/predicate"
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
)
|
||||
|
||||
// ID filters vertices based on their ID field.
|
||||
func ID(id int) predicate.Card {
|
||||
return predicate.Card(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDEQ applies the EQ predicate on the ID field.
|
||||
func IDEQ(id int) predicate.Card {
|
||||
return predicate.Card(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDNEQ applies the NEQ predicate on the ID field.
|
||||
func IDNEQ(id int) predicate.Card {
|
||||
return predicate.Card(sql.FieldNEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDIn applies the In predicate on the ID field.
|
||||
func IDIn(ids ...int) predicate.Card {
|
||||
return predicate.Card(sql.FieldIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDNotIn applies the NotIn predicate on the ID field.
|
||||
func IDNotIn(ids ...int) predicate.Card {
|
||||
return predicate.Card(sql.FieldNotIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDGT applies the GT predicate on the ID field.
|
||||
func IDGT(id int) predicate.Card {
|
||||
return predicate.Card(sql.FieldGT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDGTE applies the GTE predicate on the ID field.
|
||||
func IDGTE(id int) predicate.Card {
|
||||
return predicate.Card(sql.FieldGTE(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLT applies the LT predicate on the ID field.
|
||||
func IDLT(id int) predicate.Card {
|
||||
return predicate.Card(sql.FieldLT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLTE applies the LTE predicate on the ID field.
|
||||
func IDLTE(id int) predicate.Card {
|
||||
return predicate.Card(sql.FieldLTE(FieldID, id))
|
||||
}
|
||||
|
||||
// Card applies equality check predicate on the "card" field. It's identical to CardEQ.
|
||||
func Card(v int) predicate.Card {
|
||||
return predicate.Card(sql.FieldEQ(FieldCard, v))
|
||||
}
|
||||
|
||||
// Status applies equality check predicate on the "status" field. It's identical to StatusEQ.
|
||||
func Status(v string) predicate.Card {
|
||||
return predicate.Card(sql.FieldEQ(FieldStatus, v))
|
||||
}
|
||||
|
||||
// Cp applies equality check predicate on the "cp" field. It's identical to CpEQ.
|
||||
func Cp(v int) predicate.Card {
|
||||
return predicate.Card(sql.FieldEQ(FieldCp, v))
|
||||
}
|
||||
|
||||
// URL applies equality check predicate on the "url" field. It's identical to URLEQ.
|
||||
func URL(v string) predicate.Card {
|
||||
return predicate.Card(sql.FieldEQ(FieldURL, v))
|
||||
}
|
||||
|
||||
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
|
||||
func CreatedAt(v time.Time) predicate.Card {
|
||||
return predicate.Card(sql.FieldEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CardEQ applies the EQ predicate on the "card" field.
|
||||
func CardEQ(v int) predicate.Card {
|
||||
return predicate.Card(sql.FieldEQ(FieldCard, v))
|
||||
}
|
||||
|
||||
// CardNEQ applies the NEQ predicate on the "card" field.
|
||||
func CardNEQ(v int) predicate.Card {
|
||||
return predicate.Card(sql.FieldNEQ(FieldCard, v))
|
||||
}
|
||||
|
||||
// CardIn applies the In predicate on the "card" field.
|
||||
func CardIn(vs ...int) predicate.Card {
|
||||
return predicate.Card(sql.FieldIn(FieldCard, vs...))
|
||||
}
|
||||
|
||||
// CardNotIn applies the NotIn predicate on the "card" field.
|
||||
func CardNotIn(vs ...int) predicate.Card {
|
||||
return predicate.Card(sql.FieldNotIn(FieldCard, vs...))
|
||||
}
|
||||
|
||||
// CardGT applies the GT predicate on the "card" field.
|
||||
func CardGT(v int) predicate.Card {
|
||||
return predicate.Card(sql.FieldGT(FieldCard, v))
|
||||
}
|
||||
|
||||
// CardGTE applies the GTE predicate on the "card" field.
|
||||
func CardGTE(v int) predicate.Card {
|
||||
return predicate.Card(sql.FieldGTE(FieldCard, v))
|
||||
}
|
||||
|
||||
// CardLT applies the LT predicate on the "card" field.
|
||||
func CardLT(v int) predicate.Card {
|
||||
return predicate.Card(sql.FieldLT(FieldCard, v))
|
||||
}
|
||||
|
||||
// CardLTE applies the LTE predicate on the "card" field.
|
||||
func CardLTE(v int) predicate.Card {
|
||||
return predicate.Card(sql.FieldLTE(FieldCard, v))
|
||||
}
|
||||
|
||||
// CardIsNil applies the IsNil predicate on the "card" field.
|
||||
func CardIsNil() predicate.Card {
|
||||
return predicate.Card(sql.FieldIsNull(FieldCard))
|
||||
}
|
||||
|
||||
// CardNotNil applies the NotNil predicate on the "card" field.
|
||||
func CardNotNil() predicate.Card {
|
||||
return predicate.Card(sql.FieldNotNull(FieldCard))
|
||||
}
|
||||
|
||||
// StatusEQ applies the EQ predicate on the "status" field.
|
||||
func StatusEQ(v string) predicate.Card {
|
||||
return predicate.Card(sql.FieldEQ(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusNEQ applies the NEQ predicate on the "status" field.
|
||||
func StatusNEQ(v string) predicate.Card {
|
||||
return predicate.Card(sql.FieldNEQ(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusIn applies the In predicate on the "status" field.
|
||||
func StatusIn(vs ...string) predicate.Card {
|
||||
return predicate.Card(sql.FieldIn(FieldStatus, vs...))
|
||||
}
|
||||
|
||||
// StatusNotIn applies the NotIn predicate on the "status" field.
|
||||
func StatusNotIn(vs ...string) predicate.Card {
|
||||
return predicate.Card(sql.FieldNotIn(FieldStatus, vs...))
|
||||
}
|
||||
|
||||
// StatusGT applies the GT predicate on the "status" field.
|
||||
func StatusGT(v string) predicate.Card {
|
||||
return predicate.Card(sql.FieldGT(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusGTE applies the GTE predicate on the "status" field.
|
||||
func StatusGTE(v string) predicate.Card {
|
||||
return predicate.Card(sql.FieldGTE(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusLT applies the LT predicate on the "status" field.
|
||||
func StatusLT(v string) predicate.Card {
|
||||
return predicate.Card(sql.FieldLT(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusLTE applies the LTE predicate on the "status" field.
|
||||
func StatusLTE(v string) predicate.Card {
|
||||
return predicate.Card(sql.FieldLTE(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusContains applies the Contains predicate on the "status" field.
|
||||
func StatusContains(v string) predicate.Card {
|
||||
return predicate.Card(sql.FieldContains(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusHasPrefix applies the HasPrefix predicate on the "status" field.
|
||||
func StatusHasPrefix(v string) predicate.Card {
|
||||
return predicate.Card(sql.FieldHasPrefix(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusHasSuffix applies the HasSuffix predicate on the "status" field.
|
||||
func StatusHasSuffix(v string) predicate.Card {
|
||||
return predicate.Card(sql.FieldHasSuffix(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusIsNil applies the IsNil predicate on the "status" field.
|
||||
func StatusIsNil() predicate.Card {
|
||||
return predicate.Card(sql.FieldIsNull(FieldStatus))
|
||||
}
|
||||
|
||||
// StatusNotNil applies the NotNil predicate on the "status" field.
|
||||
func StatusNotNil() predicate.Card {
|
||||
return predicate.Card(sql.FieldNotNull(FieldStatus))
|
||||
}
|
||||
|
||||
// StatusEqualFold applies the EqualFold predicate on the "status" field.
|
||||
func StatusEqualFold(v string) predicate.Card {
|
||||
return predicate.Card(sql.FieldEqualFold(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusContainsFold applies the ContainsFold predicate on the "status" field.
|
||||
func StatusContainsFold(v string) predicate.Card {
|
||||
return predicate.Card(sql.FieldContainsFold(FieldStatus, v))
|
||||
}
|
||||
|
||||
// CpEQ applies the EQ predicate on the "cp" field.
|
||||
func CpEQ(v int) predicate.Card {
|
||||
return predicate.Card(sql.FieldEQ(FieldCp, v))
|
||||
}
|
||||
|
||||
// CpNEQ applies the NEQ predicate on the "cp" field.
|
||||
func CpNEQ(v int) predicate.Card {
|
||||
return predicate.Card(sql.FieldNEQ(FieldCp, v))
|
||||
}
|
||||
|
||||
// CpIn applies the In predicate on the "cp" field.
|
||||
func CpIn(vs ...int) predicate.Card {
|
||||
return predicate.Card(sql.FieldIn(FieldCp, vs...))
|
||||
}
|
||||
|
||||
// CpNotIn applies the NotIn predicate on the "cp" field.
|
||||
func CpNotIn(vs ...int) predicate.Card {
|
||||
return predicate.Card(sql.FieldNotIn(FieldCp, vs...))
|
||||
}
|
||||
|
||||
// CpGT applies the GT predicate on the "cp" field.
|
||||
func CpGT(v int) predicate.Card {
|
||||
return predicate.Card(sql.FieldGT(FieldCp, v))
|
||||
}
|
||||
|
||||
// CpGTE applies the GTE predicate on the "cp" field.
|
||||
func CpGTE(v int) predicate.Card {
|
||||
return predicate.Card(sql.FieldGTE(FieldCp, v))
|
||||
}
|
||||
|
||||
// CpLT applies the LT predicate on the "cp" field.
|
||||
func CpLT(v int) predicate.Card {
|
||||
return predicate.Card(sql.FieldLT(FieldCp, v))
|
||||
}
|
||||
|
||||
// CpLTE applies the LTE predicate on the "cp" field.
|
||||
func CpLTE(v int) predicate.Card {
|
||||
return predicate.Card(sql.FieldLTE(FieldCp, v))
|
||||
}
|
||||
|
||||
// CpIsNil applies the IsNil predicate on the "cp" field.
|
||||
func CpIsNil() predicate.Card {
|
||||
return predicate.Card(sql.FieldIsNull(FieldCp))
|
||||
}
|
||||
|
||||
// CpNotNil applies the NotNil predicate on the "cp" field.
|
||||
func CpNotNil() predicate.Card {
|
||||
return predicate.Card(sql.FieldNotNull(FieldCp))
|
||||
}
|
||||
|
||||
// URLEQ applies the EQ predicate on the "url" field.
|
||||
func URLEQ(v string) predicate.Card {
|
||||
return predicate.Card(sql.FieldEQ(FieldURL, v))
|
||||
}
|
||||
|
||||
// URLNEQ applies the NEQ predicate on the "url" field.
|
||||
func URLNEQ(v string) predicate.Card {
|
||||
return predicate.Card(sql.FieldNEQ(FieldURL, v))
|
||||
}
|
||||
|
||||
// URLIn applies the In predicate on the "url" field.
|
||||
func URLIn(vs ...string) predicate.Card {
|
||||
return predicate.Card(sql.FieldIn(FieldURL, vs...))
|
||||
}
|
||||
|
||||
// URLNotIn applies the NotIn predicate on the "url" field.
|
||||
func URLNotIn(vs ...string) predicate.Card {
|
||||
return predicate.Card(sql.FieldNotIn(FieldURL, vs...))
|
||||
}
|
||||
|
||||
// URLGT applies the GT predicate on the "url" field.
|
||||
func URLGT(v string) predicate.Card {
|
||||
return predicate.Card(sql.FieldGT(FieldURL, v))
|
||||
}
|
||||
|
||||
// URLGTE applies the GTE predicate on the "url" field.
|
||||
func URLGTE(v string) predicate.Card {
|
||||
return predicate.Card(sql.FieldGTE(FieldURL, v))
|
||||
}
|
||||
|
||||
// URLLT applies the LT predicate on the "url" field.
|
||||
func URLLT(v string) predicate.Card {
|
||||
return predicate.Card(sql.FieldLT(FieldURL, v))
|
||||
}
|
||||
|
||||
// URLLTE applies the LTE predicate on the "url" field.
|
||||
func URLLTE(v string) predicate.Card {
|
||||
return predicate.Card(sql.FieldLTE(FieldURL, v))
|
||||
}
|
||||
|
||||
// URLContains applies the Contains predicate on the "url" field.
|
||||
func URLContains(v string) predicate.Card {
|
||||
return predicate.Card(sql.FieldContains(FieldURL, v))
|
||||
}
|
||||
|
||||
// URLHasPrefix applies the HasPrefix predicate on the "url" field.
|
||||
func URLHasPrefix(v string) predicate.Card {
|
||||
return predicate.Card(sql.FieldHasPrefix(FieldURL, v))
|
||||
}
|
||||
|
||||
// URLHasSuffix applies the HasSuffix predicate on the "url" field.
|
||||
func URLHasSuffix(v string) predicate.Card {
|
||||
return predicate.Card(sql.FieldHasSuffix(FieldURL, v))
|
||||
}
|
||||
|
||||
// URLIsNil applies the IsNil predicate on the "url" field.
|
||||
func URLIsNil() predicate.Card {
|
||||
return predicate.Card(sql.FieldIsNull(FieldURL))
|
||||
}
|
||||
|
||||
// URLNotNil applies the NotNil predicate on the "url" field.
|
||||
func URLNotNil() predicate.Card {
|
||||
return predicate.Card(sql.FieldNotNull(FieldURL))
|
||||
}
|
||||
|
||||
// URLEqualFold applies the EqualFold predicate on the "url" field.
|
||||
func URLEqualFold(v string) predicate.Card {
|
||||
return predicate.Card(sql.FieldEqualFold(FieldURL, v))
|
||||
}
|
||||
|
||||
// URLContainsFold applies the ContainsFold predicate on the "url" field.
|
||||
func URLContainsFold(v string) predicate.Card {
|
||||
return predicate.Card(sql.FieldContainsFold(FieldURL, v))
|
||||
}
|
||||
|
||||
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
|
||||
func CreatedAtEQ(v time.Time) predicate.Card {
|
||||
return predicate.Card(sql.FieldEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
|
||||
func CreatedAtNEQ(v time.Time) predicate.Card {
|
||||
return predicate.Card(sql.FieldNEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtIn applies the In predicate on the "created_at" field.
|
||||
func CreatedAtIn(vs ...time.Time) predicate.Card {
|
||||
return predicate.Card(sql.FieldIn(FieldCreatedAt, vs...))
|
||||
}
|
||||
|
||||
// CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
|
||||
func CreatedAtNotIn(vs ...time.Time) predicate.Card {
|
||||
return predicate.Card(sql.FieldNotIn(FieldCreatedAt, vs...))
|
||||
}
|
||||
|
||||
// CreatedAtGT applies the GT predicate on the "created_at" field.
|
||||
func CreatedAtGT(v time.Time) predicate.Card {
|
||||
return predicate.Card(sql.FieldGT(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtGTE applies the GTE predicate on the "created_at" field.
|
||||
func CreatedAtGTE(v time.Time) predicate.Card {
|
||||
return predicate.Card(sql.FieldGTE(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtLT applies the LT predicate on the "created_at" field.
|
||||
func CreatedAtLT(v time.Time) predicate.Card {
|
||||
return predicate.Card(sql.FieldLT(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtLTE applies the LTE predicate on the "created_at" field.
|
||||
func CreatedAtLTE(v time.Time) predicate.Card {
|
||||
return predicate.Card(sql.FieldLTE(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtIsNil applies the IsNil predicate on the "created_at" field.
|
||||
func CreatedAtIsNil() predicate.Card {
|
||||
return predicate.Card(sql.FieldIsNull(FieldCreatedAt))
|
||||
}
|
||||
|
||||
// CreatedAtNotNil applies the NotNil predicate on the "created_at" field.
|
||||
func CreatedAtNotNil() predicate.Card {
|
||||
return predicate.Card(sql.FieldNotNull(FieldCreatedAt))
|
||||
}
|
||||
|
||||
// HasOwner applies the HasEdge predicate on the "owner" edge.
|
||||
func HasOwner() predicate.Card {
|
||||
return predicate.Card(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
})
|
||||
}
|
||||
|
||||
// HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates).
|
||||
func HasOwnerWith(preds ...predicate.User) predicate.Card {
|
||||
return predicate.Card(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(OwnerInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn),
|
||||
)
|
||||
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.Card) predicate.Card {
|
||||
return predicate.Card(func(s *sql.Selector) {
|
||||
s1 := s.Clone().SetP(nil)
|
||||
for _, p := range predicates {
|
||||
p(s1)
|
||||
}
|
||||
s.Where(s1.P())
|
||||
})
|
||||
}
|
||||
|
||||
// Or groups predicates with the OR operator between them.
|
||||
func Or(predicates ...predicate.Card) predicate.Card {
|
||||
return predicate.Card(func(s *sql.Selector) {
|
||||
s1 := s.Clone().SetP(nil)
|
||||
for i, p := range predicates {
|
||||
if i > 0 {
|
||||
s1.Or()
|
||||
}
|
||||
p(s1)
|
||||
}
|
||||
s.Where(s1.P())
|
||||
})
|
||||
}
|
||||
|
||||
// Not applies the not operator on the given predicate.
|
||||
func Not(p predicate.Card) predicate.Card {
|
||||
return predicate.Card(func(s *sql.Selector) {
|
||||
p(s.Not())
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user