Compare GORM vs pgx and see what are their differences.


The fantastic ORM library for Golang, aims to be developer friendly (by go-gorm)


PostgreSQL driver and toolkit for Go (by jackc)
Our great sponsors
  • Nanos - Run Linux Software Faster and Safer than Linux with Unikernels
  • Scout APM - A developer's best friend. Try free for 14-days
  • SaaSHub - Software Alternatives and Reviews
GORM pgx
20 19
25,575 4,631
2.3% -
9.2 8.0
6 days ago 11 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.


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 2021-09-30.
  • Migrating from PHP to Go
    reddit.com/r/golang | 2021-09-30
    Do you like an ORM like eloquent for Laravel? Then I can recommend GORM https://gorm.io/
    reddit.com/r/golang | 2021-09-30
    Good ORM library: https://gorm.io/
  • 5chan - The 4chan clone
    dev.to | 2021-09-18
  • How We Went All In on sqlc/pgx for Postgres + Go
    reddit.com/r/golang | 2021-09-09
    Well, if you look at Gorm's prepare_stmt.go you see that it is a thin wrapper around a database/sql.Stmt. And if you look at database/sql.Stmt you see that it's a sort of handle to an abstract entity that it creates in the database.
  • Go, Kafka and gRPC clean architecture CQRS microservices with Jaeger tracing 👋🧑‍💻
    dev.to | 2021-08-29
    Writer service consumes kafka topics, process messages writing to postgres and publishes successfully processed messages to kafka. For working with postgres in Go in my opinion the best choose is pgx, but if you need query builder very good library is squirrel, personally don't like orm's, but usually as have seen, teams often uses gorm, it's up to you. ProcessMessages method listening kafka topics and call specific method depends on topic:
  • What Knowledge Golang Back End Developer Should Have?
    reddit.com/r/golang | 2021-08-24
    gorm's performance I believe is fairly impressive at this point. While it was bad at first, they put a lot of effort in the v2 release to make it great. Check out: https://github.com/go-gorm/gorm/issues/3055
  • Read table from database without knowng its field in golang
    reddit.com/r/golang | 2021-08-08
    Sure. You can do this, but I would honestly recommend to only do this in test code, if at all. Otherwise, you should aim to keep types and by that the according API to interact with your DB schema static and consistent. An easy way to do this would be to use an object relational mapper (ORM) library like gorm.
  • What is the best solution to unique data in golang
    reddit.com/r/golang | 2021-08-05
    Once in sqlite you can use something like https://gorm.io/ (or use a golang sqlite package like: github.com/mattn/go-sqlite3) to work with the data.
  • Database for Go projects?
    reddit.com/r/golang | 2021-06-20
    If you and your team currently don't have any specific requirements, I'd advice to choose an abstraction library that have supports for most common dbs (eg. gorm or bun) and start with whatever db you are more used to.
  • Which is the best go web framework for creating a rest api 's backend ?
    reddit.com/r/golang | 2021-06-19
    DB abstractions: - gorm - go-pg - bun - sqlx


Posts with mentions or reviews of pgx. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-10-03.
  • psql slow intial connection?
    Connecting from my golang app via pgx database driver inside Docker (Alpine linux image) on my windows dev system: < 1s -> fast
  • Effective Go
    news.ycombinator.com | 2021-10-03
    > What kind of language recommends[0] with a straight face that you just duplicate your entire codebase into a v2/ subdirectory?

    Not Go at least. You misunderstood the post completely.

    Here is an example of how you are supposed to change the import path for subsequent major versions (that is, backwards incompatible versions): https://github.com/jackc/pgx/blob/3599f646293c1b0d381214ab26...

    A one-line change to your modfile and the import path is changed.

  • Go for Backend development
    reddit.com/r/golang | 2021-09-06
    Pass on the frameworks at first. just use the std library's net/http package and maybe a really basic router like julien schmidt's httprouter(https://github.com/julienschmidt/httprouter) to do your requests and use pgx(https://github.com/jackc/pgx) for postrgres.
    reddit.com/r/golang | 2021-09-06
    postgres in go I've mostly seen done with pgx which kind of skates around the typical database/sql method. It's better maintained and faster than the more 'official' postgres driver, but I kind of hated using it.
  • Go, Kafka and gRPC clean architecture CQRS microservices with Jaeger tracing 👋🧑‍💻
    dev.to | 2021-08-29
    In this article let's try to create closer to real world CQRS microservices with tracing and monitoring using: 🚀 Kafka as messages broker gRPC Go implementation of gRPC PostgreSQL as database Jaeger open source, end-to-end distributed tracing Prometheus monitoring and alerting Grafana for to compose observability dashboards with everything from Prometheus MongoDB Web and API based SMTP testing Redis Type-safe Redis client for Golang swag Swagger for Go Echo web framework
  • Any good git repos made by a single dev?
    reddit.com/r/golang | 2021-08-18
    https://github.com/jackc/pgx/ - started as 1 person, exploded to 129 contributors
  • What are your favorite packages to use?
    reddit.com/r/golang | 2021-08-15
    Here is link number 1 - Previous text "PGX"
    reddit.com/r/golang | 2021-08-15
    PGX driver for Postgres
  • 🤷‍♀️ 🤷‍♂️ PostgreSQL error with using over jackc/pgx driver in Golang: cannot convert X to Y
    dev.to | 2021-08-10
    When developing a REST API (or any other product) in Golang with PostgreSQL database over the high-performance driver jackc/pgx, sometimes you may get a simple error that can be confusing to search for information. Especially, newcomers.
  • What are the most useful packages you know for Go?
    reddit.com/r/golang | 2021-07-25
    https://github.com/jackc/pgx - excellent library for Postgre. Especially if you need PSQL specific features

What are some alternatives?

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

ent - An entity framework for Go


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

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

beego orm

pq - Pure Go Postgres driver for database/sql

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

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

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

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

pop/soda - A Tasty Treat For All Your Database Needs

REL - :gem: Database Access Layer for Golang - Testable, Extendable and Crafted Into a Clean and Elegant API