stephenafamo / bob

SQL query builder and ORM/Factory generator for Go with support for PostgreSQL, MySQL and SQLite
https://bob.stephenafamo.com
MIT License
760 stars 39 forks source link

Add MustCreate and MustCreateMany methods to Templates #223

Closed pcriv closed 3 months ago

pcriv commented 4 months ago

I think it would be useful to have these methods as extra methods for testing. I could try to do a PR for this if you agree this is a good idea

stephenafamo commented 4 months ago

These would be nice.

Another set of methods I want to add is CreateOrFail(tb *testing.TB) and CreateManyOrFail(tb *testing.TB). These should call tb.Fatalf() if there is an error. This is likely better than a panic.

Also, if you do send in a PR, kindly add some documentation for it 🙏🏾

stephenafamo commented 3 months ago

Implemented in #230