[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
  • InfluxDB - Access the most powerful time series database as a service
  • SonarQube - Static code analysis for 29 languages.
  • 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)

  • InfluxDB

    Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.

  • 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