Files
ent/examples/m2m2types
Jelmer Snoeck b150cde478 entc/gen: introduce validation errors (#547)
This introduces the concept of validation errors, where we have a high
level validation error which wraps a more detailed error message.

The higher level `ValidationError` is set up in the generated files, much
like the `NotFoundError` and `ConstraintError` and is accompanied by an
`IsValidationError` check method. Thus, it can be used as follows:

```go
t, err := tx.Team.Create().SetName(input.Name).Save(ctx)
if ent.IsValidationError(err) {
        // handle validation error response
}
```
2020-06-17 17:11:39 +03:00
..
2019-12-09 09:05:05 +02:00

Groups-Users M2M Relation

In this groups-users example, we have a M2M relation between groups and their users. Each group has many users, and each user can be joined to many groups.

Generate Assets

go generate ./...

Run Example

go test