Schema describes the definition of one entity type in the graph, like
and can contain the following configurations:
- Entity fields (or properties), like: name or age of a
- Entity edges (or relations), like:
User's groups, or
- Database specific options, like: indexes or unique indexes.
Here's an example of a schema:
Entity schemas are usually stored inside
ent/schema directory under
the root directory of your project, and can be generated by
entc as follows:
If you are used to the definition of relations over edges, that's fine.
The modeling is the same. You can model with
ent whatever you can model
with other traditional ORMs.
There are many examples in this website that can help you get started
in the Edges section.