mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
File diff suppressed because one or more lines are too long
@@ -6,7 +6,7 @@ in the LICENSE file in the root directory of this source tree.
|
||||
|
||||
{{/* constants needed for gremlin dialects. */}}
|
||||
{{ define "dialect/gremlin/meta/constants" }}
|
||||
{{ range $_, $e := $.Edges }}{{ $label := $e.LabelConstant -}}
|
||||
{{ range $e := $.Edges }}{{ $label := $e.LabelConstant -}}
|
||||
{{ if $e.IsInverse }}{{- $label = $e.InverseLabelConstant -}}
|
||||
// {{ $label }} holds the string label denoting the {{ lower $e.Name }} inverse edge type in the database.
|
||||
{{ else -}}
|
||||
|
||||
@@ -35,12 +35,13 @@ func ID(id {{ $.ID.Type }}) predicate.{{ $.Name }} {
|
||||
{{ end }}
|
||||
|
||||
{{ range $f := $.Fields }}
|
||||
{{ $func := $f.StructField }}
|
||||
{{/* JSON cannot be compared using "=" and Enum has a type defined with the field name */}}
|
||||
{{ $hasP := not (or $f.IsJSON $f.IsEnum) }}
|
||||
{{ $comparable := $f.ConvertedToBasic }}
|
||||
{{- if and $hasP $comparable }}
|
||||
{{ $undeclared := (and (ne $func "Label") (ne $func "Hooks") (ne $func "Policy")) }}
|
||||
{{- if and $hasP $comparable $undeclared }}
|
||||
{{ $arg := "v" }}
|
||||
{{ $func := $f.StructField }}
|
||||
// {{ $func }} applies equality check predicate on the {{ quote $f.Name }} field. It's identical to {{ $func }}EQ.
|
||||
func {{ $func }}({{ $arg }} {{ $f.Type }}) predicate.{{ $.Name }} {
|
||||
{{- if $f.HasGoType }}
|
||||
|
||||
Reference in New Issue
Block a user