[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 reddit.com/r/golang

Our great sponsors
  • OPS - Build and Run Open Source Unikernels
  • SonarQube - Static code analysis for 29 languages.
  • Scout APM - Less time debugging, more time building
  • GitHub repo 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.

  • GitHub repo social

    social network in GRPC, Go, mysql, and vuejs,

  • OPS

    OPS - Build and Run Open Source Unikernels. Quickly and easily build and deploy open source unikernels in tens of seconds. Deploy in any language to any cloud.

  • GitHub repo 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