entc/gen: skip Table() predicate and warn about reserved schema name (Client) (#2486)

* entc/gen: do no generate `Table()` predicate and warn the user in case of reserved schema name like `Client`.

* doc/md: document reserved schema name

* doc/md: revert reserved schema name as this was already working

* doc/md: rephrase
This commit is contained in:
MasseElch
2022-04-20 16:30:59 +02:00
committed by GitHub
parent 4e1affecbc
commit 2c8e58ce94
17 changed files with 630 additions and 3 deletions

View File

@@ -58,6 +58,12 @@ the root directory of your project, and can be generated by `entc` as follows:
go run entgo.io/ent/cmd/ent init User Group
```
:::note
Please note, that some schema names (like `Client`) are not available due to
[internal use](https://pkg.go.dev/entgo.io/ent/entc/gen#ValidSchemaName). You can circumvent reserved names by using an
annotation as mentioned [here](schema-annotations.md#custom-table-name).
:::
## It's Just Another ORM
If you are used to the definition of relations over edges, that's fine.