mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc: add idtype option codegen
Reviewed By: alexsn Differential Revision: D16601757 fbshipit-source-id: 35d5fbfb4ef40bae192e084ad4e067880175e71c
This commit is contained in:
committed by
Facebook Github Bot
parent
c203f043cf
commit
2cc8286f5f
@@ -30,8 +30,8 @@ func ID(id string) predicate.Node {
|
||||
func IDEQ(id string) predicate.Node {
|
||||
return predicate.NodePerDialect(
|
||||
func(s *sql.Selector) {
|
||||
v, _ := strconv.Atoi(id)
|
||||
s.Where(sql.EQ(s.C(FieldID), v))
|
||||
id, _ := strconv.Atoi(id)
|
||||
s.Where(sql.EQ(s.C(FieldID), id))
|
||||
},
|
||||
func(t *dsl.Traversal) {
|
||||
t.HasID(p.EQ(id))
|
||||
@@ -43,8 +43,8 @@ func IDEQ(id string) predicate.Node {
|
||||
func IDNEQ(id string) predicate.Node {
|
||||
return predicate.NodePerDialect(
|
||||
func(s *sql.Selector) {
|
||||
v, _ := strconv.Atoi(id)
|
||||
s.Where(sql.NEQ(s.C(FieldID), v))
|
||||
id, _ := strconv.Atoi(id)
|
||||
s.Where(sql.NEQ(s.C(FieldID), id))
|
||||
},
|
||||
func(t *dsl.Traversal) {
|
||||
t.HasID(p.NEQ(id))
|
||||
@@ -56,8 +56,8 @@ func IDNEQ(id string) predicate.Node {
|
||||
func IDGT(id string) predicate.Node {
|
||||
return predicate.NodePerDialect(
|
||||
func(s *sql.Selector) {
|
||||
v, _ := strconv.Atoi(id)
|
||||
s.Where(sql.GT(s.C(FieldID), v))
|
||||
id, _ := strconv.Atoi(id)
|
||||
s.Where(sql.GT(s.C(FieldID), id))
|
||||
},
|
||||
func(t *dsl.Traversal) {
|
||||
t.HasID(p.GT(id))
|
||||
@@ -69,8 +69,8 @@ func IDGT(id string) predicate.Node {
|
||||
func IDGTE(id string) predicate.Node {
|
||||
return predicate.NodePerDialect(
|
||||
func(s *sql.Selector) {
|
||||
v, _ := strconv.Atoi(id)
|
||||
s.Where(sql.GTE(s.C(FieldID), v))
|
||||
id, _ := strconv.Atoi(id)
|
||||
s.Where(sql.GTE(s.C(FieldID), id))
|
||||
},
|
||||
func(t *dsl.Traversal) {
|
||||
t.HasID(p.GTE(id))
|
||||
@@ -82,8 +82,8 @@ func IDGTE(id string) predicate.Node {
|
||||
func IDLT(id string) predicate.Node {
|
||||
return predicate.NodePerDialect(
|
||||
func(s *sql.Selector) {
|
||||
v, _ := strconv.Atoi(id)
|
||||
s.Where(sql.LT(s.C(FieldID), v))
|
||||
id, _ := strconv.Atoi(id)
|
||||
s.Where(sql.LT(s.C(FieldID), id))
|
||||
},
|
||||
func(t *dsl.Traversal) {
|
||||
t.HasID(p.LT(id))
|
||||
@@ -95,8 +95,8 @@ func IDLT(id string) predicate.Node {
|
||||
func IDLTE(id string) predicate.Node {
|
||||
return predicate.NodePerDialect(
|
||||
func(s *sql.Selector) {
|
||||
v, _ := strconv.Atoi(id)
|
||||
s.Where(sql.LTE(s.C(FieldID), v))
|
||||
id, _ := strconv.Atoi(id)
|
||||
s.Where(sql.LTE(s.C(FieldID), id))
|
||||
},
|
||||
func(t *dsl.Traversal) {
|
||||
t.HasID(p.LTE(id))
|
||||
|
||||
Reference in New Issue
Block a user