[HELP] Testing SQL queries and functions that use SQL queries in Golang.

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

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • dockertest

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

    I don't know if you're familiar with Docker, but there's a package called ory/dockertest that allows you to run a container per suite (or per test it's up to you), that way you can actually test the code against a real local running database.

  • social

    social network in GRPC, Go, mysql, and vuejs, (by imran31415)

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

  • go-sqlmock

    Sql mock driver for golang to test database interactions

    For testing DB queries I use https://github.com/DATA-DOG/go-sqlmock for unit tests. I then have a separate integration test suite that runs against all our services using Docker.

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