Creating an API using Go and sqlc

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • InfluxDB - Access the most powerful time series database as a service
  • SonarLint - Clean code begins in your IDE with SonarLint
  • SaaSHub - Software Alternatives and Reviews
  • Squirrel

    Fluent SQL generation for golang

    use some lib that facilitates SQL generation, like Squirrel

  • post-sqlc

    Code used in a post about sqlc.dev

    db.go - contains the interfaces, structs, and constructors

  • 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 that, I used the lib go-sqlmock. So, for example, the following snippet is part of the person/service_test.go file:

  • sqlc

    Generate type-safe code from SQL

    I will present in this post a project that fits in the last category: sqlc.

  • sqlx

    general purpose extensions to golang's database/sql

    Implement the Repository interface by writing the queries in code, perhaps using some solution like Squirrel or sqlx.

  • SonarLint

    Clean code begins in your IDE with SonarLint. Up your coding game and discover issues early. SonarLint is a free plugin that helps you find & fix bugs and security issues from the moment you start writing code. Install from your favorite IDE marketplace today.

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