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

Project Samples

Project Activity

See All Activity >

Categories

Database

License

MIT License

Follow Sql driver mock for Golang

Sql driver mock for Golang Web Site

Other Useful Business Software
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Sql driver mock for Golang!

Additional Project Details

Programming Language

Go

Related Categories

Go Database Software

Registered

2022-07-18