sqlx VS ent

Compare sqlx vs ent and see what are their differences.


general purpose extensions to golang's database/sql (by jmoiron)


An entity framework for Go (by facebook)
Our great sponsors
  • SonarLint - Deliver Cleaner and Safer Code - Right in Your IDE of Choice!
  • Scout APM - Less time debugging, more time building
  • OPS - Build and Run Open Source Unikernels
sqlx ent
25 61
11,331 9,668
- 4.7%
4.8 9.7
about 2 months ago 3 days ago
Go Go
MIT License Apache License 2.0
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 sqlx. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-01-15.


Posts with mentions or reviews of ent. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-01-23.
  • ariga/atlas: a new database migration library and CLI with a Terraform-like syntax
    4 projects | reddit.com/r/golang | 23 Jan 2022
    As of last week, Atlas is used as the migration engine for Ent, a widely popular entity framework for Go.
    4 projects | reddit.com/r/golang | 23 Jan 2022
    It already has a fluent API for Go. This one actually used by Ent.
  • Atlas – Terraform but for Database Migrations
    9 projects | news.ycombinator.com | 20 Jan 2022
    Hey, I'm one of the atlas's creator. Thanks for the feedback.

    I'm actually familiar with all the things you mentioned here (I worked at FB too ;)), and some of them are the reasons why we decided to create atlas and OSS it.

    First, atm, we support HCL and Go (with fluent API) for describing schemas, but in the next versions, we'll add support for SQL DDLs (e.g. "CREATE TABLE", "CREATE INDEX", etc). Can't promise time estimation because it's in development, but that means we plan to OSS with it an SQL-parser infrastructure for the supported databases (can elaborate on that if you want).

    Before I continue to migration authoring, I want to mention the reason we chose HCL (or Go). In next versions, we plan to support attaching "annotations" to schemas, like in k8s or in [ent](https://entgo.io). We these annotations, you'll be able to define privacy policy, or create integration to other tool. More details in the near future.

    Now, migration authoring. The CLI does not expose all functionalities that are covered by the core engine atm, but when you run this tool (apply/plan) the output is a list of SQL statements. The core engine already knows to generate the "reverse" command for each statement (if it is reversible), and also a summary that indicates if the migration is "transactional" and "reversible".

    9 projects | news.ycombinator.com | 20 Jan 2022
    One of Atlas's creators here.

    Indeed it is. We founded Ariga (the company that's maintaining Atlas) to build this kind of infrastructure which we feel is missing from the data infra/platform engineering landscape. Aside from our existing love for open-source (we maintain https://entgo.io), we are building Atlas in the open because we understand the scope of the problem and it's long-tail characteristics and realize that it will have to be a community effort.

  • Sql generator but for SQLite
    4 projects | reddit.com/r/golang | 26 Dec 2021
    Ent is my favourite data access layer for Go. It uses code generation to make things type safe, and treats your schema like a graph which IMO makes it way nicer to work with and is one of the reasons I love Ent.
  • Golang + sveltekit
    6 projects | reddit.com/r/golang | 23 Dec 2021
    When we started with a more specific focus and schema (and switched to Ent as our data access layer), the question to remove GraphQL was not discussed, but over time we found that supporting it was a lot of effort when the REST API can do everything we need it to.
  • What kind of things have you ran with go:generate?
    6 projects | reddit.com/r/golang | 16 Dec 2021
  • Boilerplate for experienced devs
    11 projects | reddit.com/r/golang | 14 Dec 2021
  • What are the things with Go that have made you wish you were back in Spring/.NET/Django etc?
    3 projects | reddit.com/r/golang | 12 Dec 2021
    ent is another sql library that uses code generation.
  • [GRPC] Use the generated proto as a model
    1 project | reddit.com/r/golang | 11 Dec 2021
    By using Ent (an open source project I help maintain) you can define your models via the ORM and can generate protobufs from them.

What are some alternatives?

When comparing sqlx and ent you can also consider the following projects:

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

pgx - PostgreSQL driver and toolkit for Go

sqlc - Generate type-safe code from SQL

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

go-sql-driver/mysql - Go MySQL Driver is a MySQL driver for Go's (golang) database/sql package

Squirrel - Fluent SQL generation for golang

gomock - GoMock is a mocking framework for the Go programming language.

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


SqlKata Query Builder - SQL query builder, written in c#, helps you build complex queries easily, supports SqlServer, MySql, PostgreSql, Oracle, Sqlite and Firebird