go-pg
Golang ORM with focus on PostgreSQL features and performance (by go-pg)
sqlx
general purpose extensions to golang's database/sql (by jmoiron)
Our great sponsors
go-pg | sqlx | |
---|---|---|
8 | 56 | |
5,318 | 13,195 | |
0.6% | - | |
5.8 | 0.0 | |
about 1 month ago | 16 days ago | |
Go | Go | |
BSD 2-clause "Simplified" 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.
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.
go-pg
Posts with mentions or reviews of go-pg.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-07-02.
-
What SQL library are you using?
I usually work with PostgreSQL and have used https://github.com/go-pg/pg. https://github.com/uptrace/bun is its successor.
- Why all the hate?
-
SQL Query Strategy for complex structs
bun and go-pg both seem to work fairly well for these kind of purposes.
- Go for Backend development
-
How much do you agree completely switching from Java to Go? I have total 9yrs of experience in Java but now I am interested in Go.
gorm.io/gorm`, or `github.com/go-pg/pg` if you need something more feature-rich. I would avoid using `go-kit` and `go-micro` "frameworks" unless you have some special requirement for it. But you can take a look to have an idea of what Go "framework" may look like.
sqlx
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 2023-01-17.
-
ORM or no ORM (and which ones)?
https://github.com/jmoiron/sqlx and github.com/lib/pq are pretty solid, this is what i go to.
-
Does Go need overcoding for tasks that other languages can execute in one liners (or with less code)?
The amount of packages imported is kind of a thing I want to remove. There is, for example, MySQL package but I use PG. Also, for many things I need sqlx, sometimes database/sql + carta. I would love to standardize all my database handling to make it simple, concise, and efficient;
-
Creating an API using Go and sqlc
Implement the Repository interface by writing the queries in code, perhaps using some solution like Squirrel or sqlx.
-
How do you handle scanning of db.Rows?
Hey, have you looked at sqlx?
-
Restful API with Golang practical approach
sqlx: sqlx is a library which provides a set of extensions on go's standard database/sql library. (https://github.com/jmoiron/sqlx)
-
Best packages?
sqlx for database connections. It allows scanning into structs which saves a lot of time and is easier to use.
-
Go w/ MSSQL - Experiences?
I typically use sqlx to deal with query results.
-
Dapper-like ORM, Mapping
Beyond that, as others have suggested, sqlx is very close to dapper in terms of functionality. It’s not generic, but generics don’t actually get you anything here except dapper will instantiate the types for you while with sqlx you have to do it yourself. Under the hood, both must use reflection to map fields.
You could try https://github.com/jmoiron/sqlx. Not sure it will satisfy your usecase to the point, but it is easy to work with wrapper of database/sql and provides some nice mappings. Take a look at https://jmoiron.github.io/sqlx/ for some more advanced use cases than just githubs README.
-
Looking for some PgSQL infos
If it is to low-level for your liking maybe take a look at sqlx or even gorm.
What are some alternatives?
When comparing go-pg and sqlx you can also consider the following projects:
pgx - PostgreSQL driver and toolkit for Go
GORM - The fantastic ORM library for Golang, aims to be developer friendly
sqlc - Generate type-safe code from SQL
gomock - GoMock is a mocking framework for the Go programming language.
Squirrel - Fluent SQL generation for golang
go-sql-driver/mysql - Go MySQL Driver is a MySQL driver for Go's (golang) database/sql package
SQLBoiler - Generate a Go ORM tailored to your database schema.
ent - An entity framework for Go
migrate - Database migrations. CLI and Golang library.
go-sqlite3 - sqlite3 driver for go using database/sql