mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entql: add driver.Valuer to generated predicates
This commit is contained in:
committed by
Ariel Mashraki
parent
1270ba1bd8
commit
a20ce535d1
@@ -117,7 +117,7 @@ type predicateAdder interface {
|
||||
{{ range $f := $n.Fields }}
|
||||
{{ $type := $f.Type.Type.String }}
|
||||
{{ $iface := print (pascal $type) "P" }}
|
||||
{{ if $f.IsTime }}{{ $iface = "TimeP" }}{{ else if $f.IsBytes }}{{ $iface = "BytesP" }}{{ end }}
|
||||
{{ if $f.IsTime }}{{ $iface = "TimeP" }}{{ else if $f.IsBytes }}{{ $iface = "BytesP" }}{{ else if $f.IsUUID }}{{ $iface = "ValueP" }}{{ end }}
|
||||
// Where{{ $f.StructField }} applies the entql {{ $type }} predicate on the {{ $f.Name }} field.
|
||||
func (f *{{ $filter }}) Where{{ $f.StructField }}(p entql.{{ $iface }}) {
|
||||
f.Where(p.Field({{ $n.Package }}.{{ $f.Constant }}))
|
||||
|
||||
Reference in New Issue
Block a user