This release contains 1 major feature, small improvements and bug fixes to ent codegen and its runtime, and an experimental integration with protobuf.
Global
- Add support for edge-fields/foreign-keys in the schema (#1213) - Thanks @alexsn, @rubensayshi, @marwan-at-work, @adayNU, @aight8 and @errorhandler for the feedback and helping designing this feature properly.
Please read more about it here - Thanks @rotemtam for the blog-post 🙏 . - Small change to all codebase. Wrap errors (replace
%v
with%w
) when it's useful - Thanks @mgabeler-lee-6rs
Code Generation
- The generated
ent.IsConstraintError
function catches now FK constraint violations (#1316) - Thanks @rotemtam - The
edge.Annotation
provides a way to override the struct-tag for theEdges
field in generated models. #1315 changes the implementation to extend the struct-tag and override the default JSON tag only if it was provided by the annotation.
Schema
- Add support for
DefaultFunc
in user-defined PKs (#1290) - Add support for MySQL spatial types in migration and add example for it - a8m/entspatial
Contrib
- OSS entproto. An experimental package for generating
.proto
files from ent/schema.
CLI
ent init
now creates a `generate.go file that matches Go 1.16 (#1300) - Thanks @uta-mori
Thanks @kercylan98, @HarikiRito, @SogoCZE, @wenj91 for reporting issues and being involved in the project.