The Power of Generics in Go: The Repository pattern for GORM

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

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

    Generate type-safe code from SQL

  • At work we are in the process of removing the repository pattern out of our codebase because it didn't support transaction (we got the code from another company). sqlc works really well to keep the code clean.

  • GORM

    The fantastic ORM library for Golang, aims to be developer friendly

  • I agree with /u/in_the_cloud that in principle it would be nicer to push that all the way into GORM itself. Perhaps it's time for a major revision branch there. There is an issue discussing generics but it seems like the beginning of a beginning of a conversation about it. It'll definitely be some work; I can virtually guarantee several passes will be necessary before a 2.x release will be possible. If nothing else, there's the initial conversion which just propagates the generics around, and then a second pass when staring at the end result shows the new ways it can be used to simplify things.

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