sqlmock is a mock library implementing sql/driver. Which has one and only purpose - to simulate any sql driver behavior in tests, without needing a real database connection. It helps to maintain correct TDD workflow. In v1.2.0 sqlmock.Rows has changed to struct from interface, if you were using any type references to that interface, you will need to switch it to a pointer struct type. Also, sqlmock.Rows were used to implement driver.Rows interface, which was not required or useful for mocking and was removed. Visit godoc for general examples and public api reference. See .travis.yml for supported go versions. Different use case, is to functionally test with a real database - go-txdb all database-related actions are isolated within a single transaction so the database can remain in the same state.
Features
- This library is now complete and stable. (you may not find new changes for this reason)
- Supports concurrency and multiple connections
- Supports go1.8 Context related feature mocking and Named sql parameters
- Does not require any modifications to your source code
- The driver allows to mock any sql driver method behavior
- Has strict by default expectation order matching