|7 days ago||9 days ago|
|BSD 2-clause "Simplified" License||MIT License|
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 for Backend development
Connecting with database
1 project | dev.to | 24 Jun 2021
For database communication we will use go-pg module. You can install it by running go get github.com/go-pg/pg/v10. This will install version 10 of go-pg module, which is latest version at the time of writing this guide. Now create new directory internal/database/ and file database.go inside of it.
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.
3 projects | reddit.com/r/golang | 18 Apr 2021
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.
A Proposal for Adding Generics to Go
1 project | news.ycombinator.com | 12 Jan 2021
This one is mostly excellent: https://github.com/go-pg/pg
Is there any Go library to backup and restore PostgreSQL?
1 project | reddit.com/r/golang | 29 Nov 2021
I don't think so, but you should look at https://github.com/jackc/pgx which have low level features maybe for replication ?
Which SQL driver to use with Postgres
7 projects | reddit.com/r/golang | 27 Nov 2021
Back to basics: Writing an application using Go and PostgreSQL
15 projects | news.ycombinator.com | 22 Nov 2021
The way it parses dates using Unix time causes issues when you compare the values returned due to Go setting the location property:
pgx doesn't seem to handle reconnects the same way lib/pg does, but I haven't tested this recently: https://github.com/jackc/pgx/issues/672
[Question] Suggested way to update a database row using gRPC/PostgreSQL (pgx) ?
3 projects | reddit.com/r/golang | 16 Nov 2021
String manipulation could lead to nasty SQL injections and really because you're using pgx there's no need to do that either, see the Conn.SendBatch method, it should allow you to achieve what you're trying to do: execute multiple queries in a transaction and still get their results. (test example)
How do the database drivers communicate with the database? Is it just through some type of protocol at a certain port?
3 projects | reddit.com/r/golang | 9 Nov 2021
Problem trying to insert data received from Colly web scraper lib into DB via pgx library
2 projects | reddit.com/r/golang | 31 Oct 2021
In the process of trying to get better with Go, I have been trying to create a program that will scrape a subreddit and then save some info into a Postgres table. In this case, I decided to use r/frugalmalefashion and save the title and flair of recent posts into the table. I am using Colly to scrape data, and pgx as the database driver.
psql slow intial connection?
1 project | reddit.com/r/PostgreSQL | 27 Oct 2021
Connecting from my golang app via pgx database driver inside Docker (Alpine linux image) on my windows dev system: < 1s -> fast
7 projects | news.ycombinator.com | 3 Oct 2021
> What kind of language recommends 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
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.
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.
What are some alternatives?
GORM - The fantastic ORM library for Golang, aims to be developer friendly
pq - Pure Go Postgres driver for database/sql
sqlx - general purpose extensions to golang's database/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
ent - An entity framework for Go
gomock - GoMock is a mocking framework for the Go programming language.
migrate - Database migrations. CLI and Golang library.
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.