mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
go: rename module from github.com/facebook/ent => entgo.io/ent (#1226)
This commit is contained in:
@@ -9,9 +9,9 @@ import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/facebook/ent/entc"
|
||||
"github.com/facebook/ent/entc/gen"
|
||||
"github.com/facebook/ent/schema/field"
|
||||
"entgo.io/ent/entc"
|
||||
"entgo.io/ent/entc/gen"
|
||||
"entgo.io/ent/schema/field"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -25,7 +25,7 @@ func BenchmarkGraph_Gen(b *testing.B) {
|
||||
Storage: storage,
|
||||
IDType: &field.TypeInfo{Type: field.TypeInt},
|
||||
Target: target,
|
||||
Package: "github.com/facebook/ent/entc/integration/ent",
|
||||
Package: "entgo.io/ent/entc/integration/ent",
|
||||
Templates: []*gen.Template{
|
||||
gen.MustParse(gen.NewTemplate("template").
|
||||
Funcs(gen.Funcs).
|
||||
|
||||
@@ -17,7 +17,7 @@ import (
|
||||
"text/template"
|
||||
"unicode"
|
||||
|
||||
"github.com/facebook/ent/schema/field"
|
||||
"entgo.io/ent/schema/field"
|
||||
|
||||
"github.com/go-openapi/inflect"
|
||||
)
|
||||
|
||||
@@ -17,9 +17,9 @@ import (
|
||||
"runtime/debug"
|
||||
"text/template/parse"
|
||||
|
||||
"github.com/facebook/ent/dialect/sql/schema"
|
||||
"github.com/facebook/ent/entc/load"
|
||||
"github.com/facebook/ent/schema/field"
|
||||
"entgo.io/ent/dialect/sql/schema"
|
||||
"entgo.io/ent/entc/load"
|
||||
"entgo.io/ent/schema/field"
|
||||
|
||||
"golang.org/x/tools/imports"
|
||||
)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/facebook/ent/entc/load"
|
||||
"github.com/facebook/ent/schema/field"
|
||||
"entgo.io/ent/entc/load"
|
||||
"entgo.io/ent/schema/field"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -8,8 +8,8 @@ import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
|
||||
"github.com/facebook/ent/dialect/gremlin/graph/dsl"
|
||||
"github.com/facebook/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/gremlin/graph/dsl"
|
||||
"entgo.io/ent/dialect/sql"
|
||||
)
|
||||
|
||||
// A SchemaMode defines what type of schema feature a storage driver support.
|
||||
@@ -52,9 +52,9 @@ var drivers = []*Storage{
|
||||
Builder: reflect.TypeOf(&sql.Selector{}),
|
||||
Dialects: []string{"dialect.SQLite", "dialect.MySQL", "dialect.Postgres"},
|
||||
Imports: []string{
|
||||
"github.com/facebook/ent/dialect/sql",
|
||||
"github.com/facebook/ent/dialect/sql/sqlgraph",
|
||||
"github.com/facebook/ent/schema/field",
|
||||
"entgo.io/ent/dialect/sql",
|
||||
"entgo.io/ent/dialect/sql/sqlgraph",
|
||||
"entgo.io/ent/schema/field",
|
||||
},
|
||||
SchemaMode: Unique | Indexes | Cascade | Migrate,
|
||||
Ops: func(f *Field) []Op {
|
||||
@@ -71,12 +71,12 @@ var drivers = []*Storage{
|
||||
Builder: reflect.TypeOf(&dsl.Traversal{}),
|
||||
Dialects: []string{"dialect.Gremlin"},
|
||||
Imports: []string{
|
||||
"github.com/facebook/ent/dialect/gremlin",
|
||||
"github.com/facebook/ent/dialect/gremlin/graph/dsl",
|
||||
"github.com/facebook/ent/dialect/gremlin/graph/dsl/__",
|
||||
"github.com/facebook/ent/dialect/gremlin/graph/dsl/g",
|
||||
"github.com/facebook/ent/dialect/gremlin/graph/dsl/p",
|
||||
"github.com/facebook/ent/dialect/gremlin/encoding/graphson",
|
||||
"entgo.io/ent/dialect/gremlin",
|
||||
"entgo.io/ent/dialect/gremlin/graph/dsl",
|
||||
"entgo.io/ent/dialect/gremlin/graph/dsl/__",
|
||||
"entgo.io/ent/dialect/gremlin/graph/dsl/g",
|
||||
"entgo.io/ent/dialect/gremlin/graph/dsl/p",
|
||||
"entgo.io/ent/dialect/gremlin/encoding/graphson",
|
||||
},
|
||||
SchemaMode: Unique,
|
||||
OpCode: opCodes(gremlinCode[:]),
|
||||
|
||||
@@ -16,7 +16,7 @@ import (
|
||||
"text/template"
|
||||
"text/template/parse"
|
||||
|
||||
"github.com/facebook/ent/entc/gen/internal"
|
||||
"entgo.io/ent/entc/gen/internal"
|
||||
)
|
||||
|
||||
//go:generate go run github.com/go-bindata/go-bindata/go-bindata -o=internal/bindata.go -pkg=internal -mode=420 -modtime=1 ./template/...
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
"{{ $.Config.Package }}/{{ $n.Package }}"
|
||||
{{- end }}
|
||||
|
||||
"github.com/facebook/ent"
|
||||
"entgo.io/ent"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -296,4 +296,4 @@ func ({{ $receiver }} *{{ $onebuilder }}) ExecX(ctx context.Context) {
|
||||
}
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
@@ -17,7 +17,7 @@ import (
|
||||
"{{ $n.Config.Package }}/{{ $n.Package }}"
|
||||
{{- end }}
|
||||
|
||||
"github.com/facebook/ent/dialect"
|
||||
"entgo.io/ent/dialect"
|
||||
{{ range $_, $import := $.Storage.Imports -}}
|
||||
"{{ $import }}"
|
||||
{{ end -}}
|
||||
|
||||
@@ -15,10 +15,10 @@ import (
|
||||
"{{ $.Config.Package }}/{{ $n.Package }}"
|
||||
{{- end }}
|
||||
|
||||
"github.com/facebook/ent/dialect/sql"
|
||||
"github.com/facebook/ent/dialect/sql/sqlgraph"
|
||||
"github.com/facebook/ent/entql"
|
||||
"github.com/facebook/ent/schema/field"
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
"entgo.io/ent/entql"
|
||||
"entgo.io/ent/schema/field"
|
||||
)
|
||||
|
||||
// schemaGraph holds a representation of ent/schema at runtime.
|
||||
|
||||
@@ -178,4 +178,4 @@ func NewSchemaConfigContext(parent context.Context, config SchemaConfig) context
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
step.Edge.Schema = schemaConfig.{{ $schema }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -80,4 +80,4 @@ func ValidColumn(column string) bool {
|
||||
{{- end }}
|
||||
return false
|
||||
}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
@@ -379,4 +379,4 @@ func ({{ $receiver }} *{{ $builder }}) sqlQuery(ctx context.Context) *sql.Select
|
||||
return &ValidationError{Name: f, err: fmt.Errorf("{{ $pkg }}: invalid field %q for query", f)}
|
||||
}
|
||||
}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
_ "{{ $.Config.Package }}/runtime"
|
||||
|
||||
{{ if $.SupportMigrate }}
|
||||
"github.com/facebook/ent/dialect/sql/schema"
|
||||
"entgo.io/ent/dialect/sql/schema"
|
||||
{{ end }}
|
||||
)
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@ import (
|
||||
{{- /* Import external packages */}}
|
||||
{{- template "import/types" $ }}
|
||||
{{- end }}
|
||||
"github.com/facebook/ent"
|
||||
"github.com/facebook/ent/dialect"
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/dialect"
|
||||
{{- with $.Storage }}
|
||||
{{- range $import := .Imports }}
|
||||
"{{ $import }}"
|
||||
@@ -55,4 +55,4 @@ import (
|
||||
{{- xtemplate $tmpl $ }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
@@ -14,4 +14,4 @@ in the LICENSE file in the root directory of this source tree.
|
||||
package internal
|
||||
|
||||
const Schema = `{{ .SchemaSnapshot }}`
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
@@ -14,8 +14,8 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/facebook/ent/dialect"
|
||||
"github.com/facebook/ent/dialect/sql/schema"
|
||||
"entgo.io/ent/dialect"
|
||||
"entgo.io/ent/dialect/sql/schema"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -15,9 +15,9 @@ import (
|
||||
"{{ $.Config.Package }}/{{ $n.Package }}"
|
||||
{{- end }}
|
||||
|
||||
"github.com/facebook/ent/dialect/entsql"
|
||||
"github.com/facebook/ent/dialect/sql/schema"
|
||||
"github.com/facebook/ent/schema/field"
|
||||
"entgo.io/ent/dialect/entsql"
|
||||
"entgo.io/ent/dialect/sql/schema"
|
||||
"entgo.io/ent/schema/field"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -13,8 +13,8 @@ in the LICENSE file in the root directory of this source tree.
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/facebook/ent/dialect/gremlin/graph/dsl"
|
||||
"github.com/facebook/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/gremlin/graph/dsl"
|
||||
"entgo.io/ent/dialect/sql"
|
||||
)
|
||||
|
||||
{{ range $_, $n := $.Nodes -}}
|
||||
|
||||
@@ -13,7 +13,7 @@ in the LICENSE file in the root directory of this source tree.
|
||||
import (
|
||||
"{{ $.Config.Package }}"
|
||||
|
||||
"github.com/facebook/ent/privacy"
|
||||
"entgo.io/ent/privacy"
|
||||
)
|
||||
|
||||
{{ $pkg := base $.Config.Package }}
|
||||
|
||||
@@ -75,8 +75,8 @@ import (
|
||||
{{- template "import/types" $n }}
|
||||
{{- end }}
|
||||
|
||||
"github.com/facebook/ent"
|
||||
"github.com/facebook/ent/privacy"
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/privacy"
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
"context"
|
||||
"sync"
|
||||
|
||||
"github.com/facebook/ent/dialect"
|
||||
"entgo.io/ent/dialect"
|
||||
)
|
||||
|
||||
// Tx is a transactional client that is created by calling Client.Tx().
|
||||
|
||||
@@ -150,4 +150,4 @@ func Not(p predicate.{{ $.Name }}) predicate.{{ $.Name }} {
|
||||
{{ end }}
|
||||
|
||||
{{/* A template that can be overridden in order to add additional code for the type package. */}}
|
||||
{{ define "where/additional" }}{{ end }}
|
||||
{{ define "where/additional" }}{{ end }}
|
||||
|
||||
@@ -17,11 +17,11 @@ import (
|
||||
"strings"
|
||||
"unicode"
|
||||
|
||||
"github.com/facebook/ent"
|
||||
"github.com/facebook/ent/dialect/entsql"
|
||||
"github.com/facebook/ent/dialect/sql/schema"
|
||||
"github.com/facebook/ent/entc/load"
|
||||
"github.com/facebook/ent/schema/field"
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/dialect/entsql"
|
||||
"entgo.io/ent/dialect/sql/schema"
|
||||
"entgo.io/ent/entc/load"
|
||||
"entgo.io/ent/schema/field"
|
||||
)
|
||||
|
||||
// The following types and their exported methods used by the codegen
|
||||
|
||||
@@ -7,8 +7,8 @@ package gen
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/facebook/ent/entc/load"
|
||||
"github.com/facebook/ent/schema/field"
|
||||
"entgo.io/ent/entc/load"
|
||||
"entgo.io/ent/schema/field"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user