entc/gen: remove multi storage support

This commit is contained in:
Ariel Mashraki
2019-12-13 17:20:06 +02:00
parent 1311f5f2f2
commit e85b10be36
226 changed files with 35018 additions and 15853 deletions

View File

@@ -15,19 +15,18 @@ in the LICENSE file in the root directory of this source tree.
{{/* custom signature for group-by function */}}
{{ define "dialect/sql/group/signature" -}}
// SQL the column wrapped with the aggregation function.
SQL func(*sql.Selector) string
type Aggregate func(*sql.Selector) string
{{- end }}
{{ define "dialect/sql/group/as" -}}
func(s *sql.Selector) string {
return sql.As(fn.SQL(s), end)
return sql.As(fn(s), end)
}
{{- end }}
{{ define "dialect/sql/group/func" -}}
{{- $fn := $.Scope.Func }}
{{- $withField := $.Scope.WithField }}
{{- $fn := $.Scope.Func -}}
{{- $withField := $.Scope.WithField -}}
func(s *sql.Selector) string {
return sql.{{ if eq $fn "Mean" }}Avg{{ else }}{{ $fn }}{{ end }}({{ if $withField }}s.C(field){{ else }}"*"{{ end }})
}