How to unit test your database interactions with Docker

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

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • gnomock

    Test your code without writing mocks with ephemeral Docker containers 📦 Setup popular services with just a couple lines of code ⏱️ No bash, no yaml, only code 💻

  • https://github.com/orlangure/gnomock does this pretty well, but I liked your solution too, it is neat.

  • go-ddd

    A practical guideline for creating DDD application in Go

  • You write easier to maintain integration tests, here’s an example: https://github.com/damianopetrungaro/go-ddd/tree/main/example/order-service/cmd/internal/repo/postgres

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • dockertest

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

  • Reminds me of https://github.com/ory/dockertest

  • vcr

    Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.

  • I also started from the same starting point but then discovered and started using VCR for creating http stubs - https://github.com/vcr/vcr. It allowed me to write against more realistic and complex test scenarios but didn't support databases.

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

  • When to mock and what to mock in a Web API?

    3 projects | /r/golang | 23 Mar 2023
  • Beginner-friendly resources to learn integration tests for MongoDb based server.

    3 projects | /r/golang | 16 Apr 2022
  • Using test helpers in Go

    1 project | dev.to | 16 Feb 2024
  • 🚀 Effortless Integration Tests with Testcontainers in Golang 🧪

    2 projects | dev.to | 4 Sep 2023
  • How to start a Go project in 2023

    21 projects | news.ycombinator.com | 23 May 2023