number of database calls, and I needed to test that my code would react to
specific results, or error conditions that could take place. Go's test
driver just really didn't fit in well for what I was trying to do.
I've created a library that allows you to create your own driver, and stub
connection failures, errors returned from queries, results returned from
queries, including a helper method to turn a CSV string into a Rows object.
You also have the ability to stub out the Query function altogether in case
you need to do custom logic like comparing the SQL call to a regular
expression, or just creating an assertion that a particular SQL call was
made.
Please check it out and share any feedback you have, let me know if it's
useful to you as well, and if there are any other use cases you have that I
have not accounted for.
https://github.com/erikstmartin/go-testdb
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.