Releases: jameycribbs/hare
Tests refactored to pass GoReportCard
I refactored the tests so that GoReportCard would stop complaining regarding gocyclo.
Make gocyclo ignore test functions.
GoReportCard was complaining about Hare's tests. Hare makes extensive use of table-driven tests so it has a lot of anonymous functions within the main test function of a test file. I don't think this is a valid problem of complexity, so I added "gocyclo:ignore" directive to all the test files so that gocyclo would ignore them. I'm not sure if this is kosher or not.
Moved dbadmin examples to separate subdirectories.
The two example files in the examples/dbadmin directory needed to be in their own subdirectory, since they both have a main function.
First public release
A few more tweaks to the readme. I think I'm going to go ahead and publicly announce this, otherwise I would continue to tweak it endlessly.
Cleanup
In an effort to get this ready for it's first public announcement, I've cleaned up various things like the readme, comments, etc. I also renamed the NewRam function to be just New.
Associations (kinda)
The big news in this release is I figured out a way to do a limited type of "belongs_to" association like in Rails. Take a look at the crud.go file in the "examples" directory to see how. This is kind of cool, not only because it is an easy way to populate associations, but is also shows that you can do some creative things in the AfterFind method.
Rename hare_err package to dberr
Golint did not like my package name for hare_err, so I changed it to dberr.
New hare_err package
All of the error variables were moved out of their respective packages and into a new hare_rec package. This was done to de-couple the errors from their respective datastores. For example, before this change, if you had code that did a Find and that record id did not exist, hare could return a disk.NoRecord or a ram.NoRecord, depending upon which back-end datastore you were using.
Now, hare will return a hare_err.NoRecord, no matter which datastore you are using. Not only is this cleaner, but it makes it possible for your code to check for a specific error by doing a call to errors.Is(err, hare_err.ErrNoRecord). This would not have been possible before since you would have had to write errors.Is(err, disk.ErrNoRecord) or errors.Is(err, ram.ErrNoRecord) depending on which datastore you were using.
v0.5.2
I added a go.mod file to the project.
v0.5.1
I have used this release to port over Alex Edward's SnippetBox from MySQL to Hare and it worked surprisingly well. So, I think I am ready for an initial release. I could mess with Hare forever and never release it, but I am anxious to get it out into the wild and get suggestions and feedback from other people.