all: move sqlgraph to its own package

This commit is contained in:
Ariel Mashraki
2019-12-17 18:22:07 +02:00
parent 58b5389275
commit 0cc74b5297
101 changed files with 4359 additions and 5072 deletions

View File

@@ -62,10 +62,10 @@ in the LICENSE file in the root directory of this source tree.
{{ define "dialect/sql/predicate/edge/has" -}}
{{- $e := $.Scope.Edge -}}
func(s *sql.Selector) {
step := sql.NewStep(
sql.From(Table, {{ $.ID.Constant }}),
sql.To({{ $e.TableConstant }}, {{ $.ID.Constant }}),
sql.Edge(sql.{{ $e.Rel.Type }}, {{ $e.IsInverse }}, {{ $e.TableConstant }},
step := sqlgraph.NewStep(
sqlgraph.From(Table, {{ $.ID.Constant }}),
sqlgraph.To({{ $e.TableConstant }}, {{ $.ID.Constant }}),
sqlgraph.Edge(sqlgraph.{{ $e.Rel.Type }}, {{ $e.IsInverse }}, {{ $e.TableConstant }},
{{- if $e.M2M -}}
{{ $e.PKConstant }}...
{{- else -}}
@@ -73,17 +73,17 @@ in the LICENSE file in the root directory of this source tree.
{{- end -}}
),
)
sql.HasNeighbors(s, step)
sqlgraph.HasNeighbors(s, step)
}
{{- end }}
{{ define "dialect/sql/predicate/edge/haswith" -}}
{{- $e := $.Scope.Edge -}}
func(s *sql.Selector) {
step := sql.NewStep(
sql.From(Table, {{ $.ID.Constant }}),
sql.To({{ if ne $.Table $e.Type.Table }}{{ $e.InverseTableConstant }}{{ else }}Table{{ end }}, {{ $.ID.Constant }}),
sql.Edge(sql.{{ $e.Rel.Type }}, {{ $e.IsInverse }}, {{ $e.TableConstant }},
step := sqlgraph.NewStep(
sqlgraph.From(Table, {{ $.ID.Constant }}),
sqlgraph.To({{ if ne $.Table $e.Type.Table }}{{ $e.InverseTableConstant }}{{ else }}Table{{ end }}, {{ $.ID.Constant }}),
sqlgraph.Edge(sqlgraph.{{ $e.Rel.Type }}, {{ $e.IsInverse }}, {{ $e.TableConstant }},
{{- if $e.M2M -}}
{{ $e.PKConstant }}...
{{- else -}}
@@ -91,7 +91,7 @@ in the LICENSE file in the root directory of this source tree.
{{- end -}}
),
)
sql.HasNeighborsWith(s, step, func(s *sql.Selector) {
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
for _, p := range preds {
p(s)
}