pgx
retry-go
Our great sponsors
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.
pgx
-
Why use Rust on the back end?
Why don't you use sqlc + pgx? What's missing from the two?
-
GORM
If u/matimuszynianka is using Postgres for the backend, github.com/jackc/pgx is a fantastic utility. You can use it with vanilla types, or you can use the github.com/jackc/pgx/v5/pgtype library with it, for dealing with nullable columns.
-
Can anyone help me on how you are using golang with databases in production systems?
Is it better to use tools like [pgx](https://github.com/jackc/pgx) or stick with a ORM like GORM.
- One Million Database Connections
- Go and PostgreSQL
-
Dapper-like ORM, Mapping
If your schema/migrations are not part of the go project then it might not be a great fit. It does support pgx which is a huge advantage imo vs plain database/sql.
-
Looking for some PgSQL infos
The Wiki doesn't help to get you started?
-
Is this a proper setup in Go for a postgres api?
Regarding postgres setup, it looks ok, I recommend considering pgx instead of libpq; reason being maintainability, libpq even recommends using pgx instead see README.
-
Building a Simple TODO App with Gin-gonic in Zerops: A step-by-step Guide
github.com/jackc/pgx/v4 (v4.17.1)
-
pgx is awesome: introducing pg_idkit
Is it related to https://github.com/jackc/pgx somehow?
retry-go
- Network Error Handling
-
retry package for golang
What is that advantage of your package compared to other ones like https://github.com/avast/retry-go?
-
Go, NATS, gRPC and PostgreSQL clean architecture microservice with monitoring and tracing 👋
processCreateEmail handling create email events, it's start tracing span, increase metrics counters, then unmarshal message data, and call usecase create method, if it fails, we retry for 3 times using retry-go, if it still fails, we check is the current message redelivered and if redelivery count > maxRedeliveryCount(it's up to your business logic, here is 3 times limit), handling error cases can be very different and depends on your service business logic, in this example used Dead Letter Queue approach.
-
Go, Kafka, gRPC and MongoDB microservice with metrics and tracing 👋
Workers validate message body then call usecase, if it's returns error, try for retry, good library for retry is retry-go, if again fails, publish error message to very simple Dead Letter Queue as i said, didn't implement here any interesting business logic, so in real production we have to handle error cases in the better way. And after message success processed commit it.
What are some alternatives?
sqlx - general purpose extensions to golang's database/sql
pq - Pure Go Postgres driver for database/sql
GORM - The fantastic ORM library for Golang, aims to be developer friendly
gomock - GoMock is a mocking framework for the Go programming language.
sqlc - Generate type-safe code from SQL
go-sql-driver/mysql - Go MySQL Driver is a MySQL driver for Go's (golang) database/sql package
migrate - Database migrations. CLI and Golang library.
goqu - SQL builder and query library for golang
kafka-go - Kafka library in Go
Gin - Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.
go-sqlite3 - sqlite3 driver for go using database/sql
bun - Incredibly fast JavaScript runtime, bundler, transpiler and package manager – all in one.