mirror of
https://github.com/ent/ent.git
synced 2026-04-29 22:20:54 +03:00
go: rename module from github.com/facebook/ent => entgo.io/ent (#1226)
This commit is contained in:
@@ -9,7 +9,7 @@ The project comes with a codegen tool called `ent`. In order to install
|
||||
`ent` run the following command:
|
||||
|
||||
```bash
|
||||
go get github.com/facebook/ent/cmd/ent
|
||||
go get entgo.io/ent/cmd/ent
|
||||
```
|
||||
|
||||
## Initialize A New Schema
|
||||
@@ -17,7 +17,7 @@ go get github.com/facebook/ent/cmd/ent
|
||||
In order to generate one or more schema templates, run `ent init` as follows:
|
||||
|
||||
```bash
|
||||
go run github.com/facebook/ent/cmd/ent init User Pet
|
||||
go run entgo.io/ent/cmd/ent init User Pet
|
||||
```
|
||||
|
||||
`init` will create the 2 schemas (`user.go` and `pet.go`) under the `ent/schema` directory.
|
||||
@@ -59,7 +59,7 @@ go mod init <project>
|
||||
And then, re-run the following command in order to add `ent` to your `go.mod` file:
|
||||
|
||||
```console
|
||||
go get github.com/facebook/ent/cmd/ent
|
||||
go get entgo.io/ent/cmd/ent
|
||||
```
|
||||
|
||||
Add a `generate.go` file to your project under `<project>/ent`:
|
||||
@@ -67,7 +67,7 @@ Add a `generate.go` file to your project under `<project>/ent`:
|
||||
```go
|
||||
package ent
|
||||
|
||||
//go:generate go run github.com/facebook/ent/cmd/ent generate ./schema
|
||||
//go:generate go run entgo.io/ent/cmd/ent generate ./schema
|
||||
```
|
||||
|
||||
Finally, you can run `go generate ./ent` from the root directory of your project
|
||||
@@ -109,7 +109,7 @@ a file with the same name as the template. The flag format supports `file`, `di
|
||||
as follows:
|
||||
|
||||
```console
|
||||
go run github.com/facebook/ent/cmd/ent generate --template <dir-path> --template glob="path/to/*.tmpl" ./ent/schema
|
||||
go run entgo.io/ent/cmd/ent generate --template <dir-path> --template glob="path/to/*.tmpl" ./ent/schema
|
||||
```
|
||||
|
||||
More information and examples can be found in the [external templates doc](templates.md).
|
||||
@@ -124,9 +124,9 @@ package main
|
||||
import (
|
||||
"log"
|
||||
|
||||
"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"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -140,7 +140,7 @@ func main() {
|
||||
}
|
||||
```
|
||||
|
||||
The full example exists in [GitHub](https://github.com/facebook/ent/tree/master/examples/entcpkg).
|
||||
The full example exists in [GitHub](https://entgo.io/ent/tree/master/examples/entcpkg).
|
||||
|
||||
|
||||
## Schema Description
|
||||
@@ -148,7 +148,7 @@ The full example exists in [GitHub](https://github.com/facebook/ent/tree/master/
|
||||
In order to get a description of your graph schema, run:
|
||||
|
||||
```bash
|
||||
go run github.com/facebook/ent/cmd/ent describe ./ent/schema
|
||||
go run entgo.io/ent/cmd/ent describe ./ent/schema
|
||||
```
|
||||
|
||||
An example for the output is as follows:
|
||||
@@ -198,8 +198,8 @@ import (
|
||||
"log"
|
||||
"reflect"
|
||||
|
||||
"github.com/facebook/ent/entc"
|
||||
"github.com/facebook/ent/entc/gen"
|
||||
"entgo.io/ent/entc"
|
||||
"entgo.io/ent/entc/gen"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
Reference in New Issue
Block a user