Mocking database or use a test database

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

InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. clover

    A lightweight document-oriented NoSQL database written in pure Golang. (by ostafen)

    Hi, recently I wrote a small NoSQL embedded database in Go. It is meant to run as a library, for those usa cases where you don't want to run a real database server. I leave here the link: https://github.com/ostafen/clover Maybe, it can be of help

  2. InfluxDB

    InfluxDB – Built for High-Performance Time Series Workloads. InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.

    InfluxDB logo
  3. dockertest

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

    Hey, If you just want to run tests against database normally I just use an interface for repository methods, and initialise a new repository connected to a new Database, personally I usually use dockertest . I launch a docker for the test DB instance, and use a defer method to drop the used table after each test. Doing this you can contain the instance of docker with DB locally and it's automatically managed by docker test.

  4. gomock

    Discontinued GoMock is a mocking framework for the Go programming language. (by golang)

    You can test the code outside those data classes using more general mocks. https://github.com/golang/mock

  5. keploy

    Unit, API & Integration Testing Agent for Developers. Generate tests, mocks/stubs for your APIs that actually work!

    You could also try Keploy . It can not only automatically manage mocking for you but also save the requests you perform as unit tests.

  6. testfixtures

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

    A lot of good suggestions here, I would also take a look at go-testfixtures which allows you to create some simple yaml-based fixture data to use with unit testing. It's quick and easy, but yes can get unwieldy the more you add.

  7. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
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

  • Why elixir over Golang

    10 projects | /r/elixir | 29 May 2023
  • Using SQLC in project how do I mock database Calls with it for unit testing?

    3 projects | /r/golang | 22 Oct 2022
  • How to mock database calls

    4 projects | /r/golang | 27 Aug 2022
  • I share my authentication server.

    18 projects | /r/golang | 20 Dec 2021
  • Unit Testing in Golang

    1 project | /r/golang | 1 Feb 2021

Did you know that Go is
the 4th most popular programming language
based on number of references?