How to mock database calls

This page summarizes the projects mentioned and recommended in the original post on /r/golang

Our great sponsors
  • SonarQube - Static code analysis for 29 languages.
  • Mergify - Tired of breaking your main and manually rebasing outdated pull requests?
  • InfluxDB - Collect and Analyze Billions of Data Points in Real Time
  • go-sqlmock

    Sql mock driver for golang to test database interactions

  • dockertest

    Write better integration tests! Dockertest helps you boot up ephermal docker images for your Go tests with minimal work.

  • SonarQube

    Static code analysis for 29 languages.. Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.

  • mongoifc

    Interfaces for the MongoDB driver

  • testfixtures

    Ruby on Rails like test fixtures for Go. Write tests against a real database

    I'm the author of https://github.com/go-testfixtures/testfixtures, a library written to make it easier to write tests with a real database and test data. You might want to use it together with docker-compose, for example.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts