- With the integration to the go/packages library,
-pkg
option now requires a Go-style package path instead of a path to the directory. If you want to use a relative path, you need to prefix it with./
or../
.
- Now supports interface embedding
-model-pkg
option to specify the package containing the model struct. Without specifying this option, it will fall back to the same value as-pkg
option.-dest-pkg
option to specify the package path to write the generated code to. Without specifying this option, it will fall back to the same value as-pkg
option.
- The constructor of the generated repository implementation now returns a pointer to the generated repository implementation instead of the repository interface.
-pkg
option now requires a Go-style package path instead of a path to the directory. Without specifying a dot (./
or../
) at the beginning of the path, Go will assume the absolute package path.
- Make find many operations return empty slice instead of nil to provide consistency when further encoded to JSON.
-src
option is now removed, replacing with-pkg
option. Repogen now supports when model struct and repository interface is placed in separate files in the same package. Instead of specifying a single Go file to scan the model struct and repository interface, you can now specify a path to the package containing with-pkg
. If the-pkg
option is not specified, it will default to the current directory.- The keyword
One
afterFind
is not allowed anymore. If you haveFindOne
declared anywhere, replace them withFind
.
- Package scanning: Instead of specifying a single Go file to scan the model struct and repository interface using
-src
option, you can now specify a path to the package containing the model struct and repository interface using-pkg
option. - Find many operations with limits: Write
TopN
keyword afterFind
to allow finding with limit N: e.g.FindTop5AllOrderByAge
. - Query comparators:
Exists
andNotExists
-src
option is removed, in favor of-pkg
option.
- Fixed decoding error when the struct tag has space characters
- Fixed error when any method parameter is assigned with map type
- Query operators:
NotIn
,True
andFalse
- Update the whole model by not specifying queries: e.g.
UpdateByID
- Sorting in find operations (both find one and find many)
- Deeply referencing to struct fields: e.g. ContactEmail = contact.email
- Update operators:
Push
andInc
- Improved error message from generation to help investigate repository interface errors
Initial release
- Supports create, read, update, delete and count functionality
- Supports single-entity and many-entity operations
- Supports AND and OR query
- Supports many comparators (equal, less than, less than or equal, greater than, greater than or equal, not equal, between, in)
- Validate method signature depending on method operations