entql: check for uuid when generating ID predicate (#1006)

This commit is contained in:
BrentChesny
2020-12-01 19:37:35 +01:00
committed by Ariel Mashraki
parent a20ce535d1
commit 425d789d96
2 changed files with 3 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@@ -109,6 +109,7 @@ type predicateAdder interface {
{{ $type := $n.ID.Type.Type.String }}
{{ $iface := print (pascal $type) "P" }}
{{ if $n.ID.IsUUID }}{{ $iface = "ValueP" }}{{ end }}
// WhereID applies the entql {{ $type }} predicate on the id field.
func (f *{{ $filter }}) WhereID(p entql.{{ $iface }}) {
f.Where(p.Field({{ $n.Package }}.{{ $n.ID.Constant }}))