generates a ton of code to have type safe acces to database and not much fucking around with strings in source code (you can if you want to for these special queries with complex partition or distinct on stuff) supports one to many (many to one) and many to many it's a model first approach , models are json config files mainly postgres but planning on supporting cockroachdb, need to implement embedded relations for that wip: need to make optional some customizations that are now generated by default.
this project is still using jteeuwen's bindata , you can use another lib to embed tmpl files into the binary
just change the go generate in ormgen.go
go generate
go install
ormgen [options] paths...
-l
maximum depth to fetch relations, all levels from 0 to max level will be available
eg user.friend -> friend is level 1, user.friend.anotherrelation -> anotherrelation is depth 2
watch out there is no reflection and the generated code is super simple but it amounts to a lot of LOC
-t
either 'go' to directly generate go structs or 'proto' to generate intermediate protobuf files
-v, -version
Print version and exit.
-h, -help
Print help and exit.