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)
Our great sponsors
  • SonarQube - Static code analysis for 29 languages.
  • InfluxDB - Build time-series-based applications quickly and at scale.
  • SaaSHub - Software Alternatives and Reviews
GORM sqlc
58 115
31,250 7,297
2.1% -
9.3 8.9
2 days ago 5 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 2023-01-25.

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 2023-01-25.
  • You might not need an ORM
    9 projects | news.ycombinator.com | 25 Jan 2023
    Relatedly, I'd like to recommend people check out sqlc. It's a Go project, although it does technically support codegen to other languages.

    https://sqlc.dev/

    With sqlc, you write queries and get fully typed functions you can call. It's not completely perfect, but it's pretty good.

    9 projects | news.ycombinator.com | 25 Jan 2023
  • Building web-based SaaS with Go as a solo entrepreneur. What should I be aware of?
    13 projects | reddit.com/r/golang | 23 Jan 2023
    How do you find it compared to using something like https://github.com/kyleconroy/sqlc ? curious which enables faster "developer velocity"
  • How to Work with SQL Databases in Go
    6 projects | reddit.com/r/golang | 19 Jan 2023
    Honestly I think the code generation approach using sqlc is better these days than manually writing all of the DB code yourself or an ORM like GORM. You are writing the queries, and it's handling the boilerplate that you'd do anyway, and it's not using introspection but rather providing type safe functions and structures for your queries.
  • ORM or no ORM (and which ones)?
    17 projects | reddit.com/r/golang | 17 Jan 2023
    I highly recommend sqlc. You just write normal SQL DDL/DML and you get statically typed Go functions and data structures.
    17 projects | reddit.com/r/golang | 17 Jan 2023
    SQL code generator (aka inspect a database or SQL files to generate data models). You have the option of using something like volatiletech/sqlboiler which looks at the a physical database and generates code based on the schema. Or SQLC which is an amazing and fast project.
    17 projects | reddit.com/r/golang | 17 Jan 2023
  • Ask HN: ORM or Native SQL?
    10 projects | news.ycombinator.com | 6 Jan 2023
    Likely depends on the language. With Go I like using https://sqlc.dev/ - it generates Go-code from a SQL script. You get the benefits of static typing for parameters and return types + it removes much of the boilerplate involved in using plain SQL. And you still get the full expressiveness of SQL. I think this is a middle ground between SQL and ORM.
  • Anything like sqlc for Rust?
    5 projects | reddit.com/r/rust | 1 Jan 2023
    I've been using Go's sqlc for a while now at work, for working with Postgres. Got to admit it's been great, better than any ORM or query builder I've used so far in any other language.
  • Best Orm that uses Graphql and Postgres
    8 projects | reddit.com/r/golang | 18 Dec 2022
    sqlc website: https://sqlc.dev

What are some alternatives?

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

ent - An entity framework for Go

Xorm

SQLBoiler - Generate a Go ORM tailored to your database schema.

go-pg - Golang ORM with focus on PostgreSQL features and performance

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

beego orm

pgx - PostgreSQL driver and toolkit for Go

gorp - Go Relational Persistence - an ORM-ish library for Go

xorm - xorm是一个简单而强大的Go语言ORM库,通过它可以使数据库操作非常简便。本库是基于原版xorm的定制增强版本,为xorm提供类似ibatis的配置文件及动态SQL支持,支持AcitveRecord操作

bun - Incredibly fast JavaScript runtime, bundler, transpiler and package manager – all in one.

upper.io/db - Data access layer for PostgreSQL, CockroachDB, MySQL, SQLite and MongoDB with ORM-like features.