Which ORM framework are you using with golang, and why?

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

    Generate a Go ORM tailored to your database schema.

  • SQLBoiler but currently building an evolved version with generics and more flexibility.

  • Squirrel

    Fluent SQL generation for golang

  • squirrel is very good when you want to parameterize a where clause in a simple query. It is bad if your query is not simple -- it has no good way to handle common table expressions or nested queries. Perhaps there's some magic I missed.

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

    WorkOS logo
  • atlas

    Manage your database schema as code (by ariga)

  • Ent with Atlas. I wrote about the motivation for creating it a year ago - https://www.reddit.com/r/golang/comments/t08oox/comment/hy8m5dy/?utm_source=share&utm_medium=web2x&context=3

  • sqlc

    Generate type-safe code from SQL

  • I typically use sqlc instead of any other ORM alternatives, in cases where you may need to build queries dynamically, for example when conditions are driven by Go code you may consider using squirrel for those cases.

  • sqlx

    general purpose extensions to golang's database/sql

  • I recommend against sqlx. If for no other reason the number of outstanding issues and pull requests.

  • migrate

    Database migrations. CLI and Golang library.

  • For migrations I use https://github.com/golang-migrate/migrate, it works great

  • ent

    An entity framework for Go

  • Ent with Atlas. I wrote about the motivation for creating it a year ago - https://www.reddit.com/r/golang/comments/t08oox/comment/hy8m5dy/?utm_source=share&utm_medium=web2x&context=3

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

    SQL-first Golang ORM (by uptrace)

  • I use Bun by Uptrace - https://github.com/uptrace/bun

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