GORM VS sqlc

Compare GORM vs sqlc and see what are their differences.

GORM

The fantastic ORM library for Golang, aims to be developer friendly (by go-gorm)
InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
GORM sqlc
83 182
38,164 15,023
0.8% 2.7%
7.5 9.0
9 days ago 3 days ago
Go Go
MIT License MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

GORM

Posts with mentions or reviews of GORM. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2025-01-03.
  • 🏷️ Sintaxe Alternativa em Go: Uma Leve Introdução às Struct Field Tags
    1 project | dev.to | 24 Mar 2025
  • Top 5 Go Libraries Every Backend Developer Should Know
    6 projects | dev.to | 3 Jan 2025
    2. GORM
  • How to use migrations with Golang
    5 projects | dev.to | 6 Nov 2024
    Go doesn't support migrations natively for that propuso we can use the popular golang-migrate package also if you use an ORM like GORM you can use it for that.
  • Toasty, an Async ORM for Rust
    6 projects | news.ycombinator.com | 23 Oct 2024
    I never understood why people are so stubborn about hating on orm.

    For example I'm familiar with https://gorm.io and it does save me a lot of time and useless boilerplate.

    And guess what, if I ever need to make a complex query, I also happen to know SQL, and I'm just going to make a "raw" query https://gorm.io/docs/sql_builder.html#Raw-SQL and be done with it.

    It's not all that hard.

  • Building a RESTful API with Go Fiber: An Express-Inspired Boilerplate
    13 projects | dev.to | 5 Oct 2024
    SQL database: PostgreSQL Object Relation Mapping using Gorm
  • Store IoT device data
    2 projects | dev.to | 26 Sep 2024
    The previous post demonstrated receiving the raw data and unmarshalling it into a struct that was already annotated with gorm tags. Gorm is a popular ORM for Go. If you are not familiar with it, you can for more information here.
  • GORM, PostgreSQL & Atlas
    4 projects | dev.to | 12 Aug 2024
    GORM is a, quite conveniently named, ORM for GO
  • Scaling Backend to 1M requests with just 2GB ram ⚡️
    2 projects | dev.to | 14 Jun 2024
    Written in GIN framework and uses GORM as ORM.
  • How to handle migrations in Golang
    5 projects | dev.to | 11 Jun 2024
    There are ORMs like gorm that supports some kind of documentation with files, but they mainly focus on converting the database to "things" in the code to be used by the ORM, and not as documentation only/documentation-first.
  • Go ORMs Compared
    5 projects | dev.to | 18 Jan 2024
    GORM is a comprehensive ORM tool in Go, offering a code-first approach which allows defining database schemas using struct tags in Go. It's known for its developer-friendly nature, making it suitable for both beginners and experienced users. GORM supports a variety of SQL databases like MySQL, PostgreSQL, and SQLite. It's designed to be flexible, allowing developers to drop down to raw SQL when necessary. However, it's important to be cautious about its performance implications in large-scale applications.

sqlc

Posts with mentions or reviews of sqlc. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2025-03-09.
  • Sqlc: Generate type-safe code from SQL
    1 project | news.ycombinator.com | 16 Apr 2025
  • sqlc: Type-Safe Querying in Go
    1 project | dev.to | 16 Mar 2025
  • Goravel: A Go framework inspired by Laravel
    9 projects | news.ycombinator.com | 9 Mar 2025
    What would you use if ORM is to be avoided?

    Perhaps something like https://github.com/sqlc-dev/sqlc ?

  • User authentication in go
    10 projects | dev.to | 30 Jan 2025
    Next, let's write sql queries for retrieving our users & their permissions. Here we will use sqlc for type-safe code generation from our sql queries, and pgx as its backend
  • Rails for Everything
    18 projects | news.ycombinator.com | 1 Jan 2025
  • Show HN: Generate type-safe code for SQL queries in any language
    2 projects | news.ycombinator.com | 27 Nov 2024
    sqlc (https://sqlc.dev/) is amazing, but I needed to use it in several unsupported languages. So instead of creating a plugin for each of those languages, I created a generic one, which is based on go templates.
  • Some Go web dev notes
    16 projects | news.ycombinator.com | 29 Sep 2024
    I really wanted to like sqlc, but it had some major limitations and minor annoyances last time I tried it a few months ago. You might want to go through its list of issues[1] before adopting it.

    Things like no support for dynamic queries[2], one-to-many relationships[3], embedded CTEs[4], composite types[5], etc.

    It might work fine if you only have simple needs, but if you ever want to do something slightly sophisticated, you'll have to fallback to the manual approach. It's partly understandable, though. It cannot realistically support every feature of every DBMS, and it's explicitly not an ORM. But I still decided to stick to the manual approach for everything, instead of wondering whether something is or isn't supported by sqlc.

    [1]: https://github.com/sqlc-dev/sqlc/issues/

    [2]: https://github.com/sqlc-dev/sqlc/issues/3414

    [3]: https://github.com/sqlc-dev/sqlc/issues/3394

    [4]: https://github.com/sqlc-dev/sqlc/issues/3128

    [5]: https://github.com/sqlc-dev/sqlc/issues/2760

  • Sqlc: Compile SQL to type-safe code
    15 projects | news.ycombinator.com | 8 Sep 2024
    I missed this too. However, I've found you can work around it pretty easily with clauses like CASE WHEN @field != "" THEN column = @field ELSE true END.

    Example from the sqlc creator (https://github.com/sqlc-dev/sqlc/discussions/364#discussionc...):

      -- name: FilterFoo :many
  • At 50 Years Old, Is SQL Becoming a Niche Skill?
    3 projects | news.ycombinator.com | 27 Jun 2024
    LOL...

    And then there is Golang. SQLC ( https://sqlc.dev ) becomes a source of truth not a sink... mix in some yaml and you have your json tags and validation mixed in.

    Candidly good engineers are still using SQL...

  • FrankenPHP: The Modern PHP App Server
    19 projects | news.ycombinator.com | 29 May 2024
    >> Also, I can think of a number of json schemas that are impossible to replicate in Go's type system but work just fine in PHP.

    Not at all. There are some that would be painful to write "by hand". An expansive and nested set of null fields would suck if I had to spell it all out...

    https://sqlc.dev << changes everything. If you add in the YAML (and I hate yaml) you can get your JSON to DB mapping in there, as well as your validations (all output as struct tags).

    Everything else that you're going to want (transforming inputs to/from json, logging, auth) is some pretty simple middleware.

What are some alternatives?

When comparing GORM and sqlc you can also consider the following projects:

pgx - PostgreSQL driver and toolkit for Go

jet - Type safe SQL builder with code generation and automatic query result data mapping

bun - SQL-first Golang ORM

ent - An entity framework for Go

sqlx - general purpose extensions to golang's database/sql

InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured

Did you know that Go is
the 4th most popular programming language
based on number of references?