Files
ent/entc/gen/template/import.tmpl
Ariel Mashraki c3955a08f1 schema/field: json type support (#38)
Summary:
Pull Request resolved: https://github.com/facebookincubator/ent/pull/38

Only `IsNil` and `NotNil` predicates are supported this moment

Reviewed By: alexsn

Differential Revision: D17444976

fbshipit-source-id: 37336fa0bc7749af995933baee2e23bb7366dd78
2019-09-19 05:00:11 -07:00

43 lines
984 B
Cheetah

{{/*
Copyright 2019-present Facebook Inc. All rights reserved.
This source code is licensed under the Apache 2.0 license found
in the LICENSE file in the root directory of this source tree.
*/}}
{{ define "import" }}
import (
"fmt"
"context"
"errors"
"math"
"strconv"
"strings"
"time"
{{- /* ignore generting on graph specififc templates */}}
{{- if not (eq $.Config.Package $.Package) }}
"{{ $.Config.Package }}/predicate"
"{{ $.Config.Package }}/{{ $.Package }}"
{{- with $.Config.Schema }}
"{{ . }}"
{{- end }}
{{- range $_, $f := $.StructFields }}
{{- with $f.PkgPath }}
"{{ . }}"
{{- end }}
{{- end }}
{{- range $_, $f := $.Fields }}
{{- with $f.Type.PkgPath }}
"{{ . }}"
{{- end }}
{{- end }}
{{- end }}
"github.com/facebookincubator/ent"
"github.com/facebookincubator/ent/dialect"
{{- range $_, $storage := $.Storage }}
{{- range $_, $import := $storage.Imports }}
"{{ $import }}"
{{- end }}
{{- end }}
)
{{ end }}