Hacker GitHub

← All repos

lib/pq

View on GitHub ↗ ★ 9,972 Go

Go PostgreSQL driver for database/sql

19 mentions on Hacker News by 19 people: 2 stories, 17 comments · first 2013-03-12 · latest 2025-12-13

Mentions per year 19 mentions · busiest year 2014 (4)
20082026
  1. > anything that depends on Go's Postgres client requires libpq which requires libc Try https://github.com/lib/pq
    comment by nateb2022 · 2025-12-13 · in Go is portable, until it isn't
  2. ▲ 2
    Show HN: Pgdbtemplate – fast PostgreSQL test databases in Go using templates
    story by andrei-polukhin · 2025-09-10 · 0 comments
  3. …tech ^ and libraries: - https://github.com/aymerick/douceur - https://github.com/jung-kurt/gofpdf - https://github.com/lib/pq - https://github.com/qiangxue/fasthttp-routing - https://github.com/valyala/fasthttp -…
    comment by craftuser · 2023-01-09 · in Ask HN: Slimvoice Alternative?
  4. …``` package main import ( "database/sql" "fmt" "log" "net/http" "time" "golang.org/x/crypto/bcrypt" _ "github.com/lib/pq" ) const ( host = "localhost" port = 5432 user = "postgres" password = "password" dbname = "mydb" ) func main() { //…
    comment by Sheeny96 · 2022-12-04 · in Building a Virtual Machine Inside ChatGPT
  5. …alternative for well-defined use cases. [1] https://github.com/meilisearch/meilisearch-go [2] https://github.com/lib/pq [3] https://pkg.go.dev/github.com/lib/pq#NewListener
    comment by bsnnkv · 2022-10-17 · in How Fly.io and Tailscale Saved Notado
  6. So says the readme: https://github.com/lib/pq#status I wonder why, though?
  7. …had problems with it, and looking at the commits on github [1] it seems far from inactive. [1] https://github.com/lib/pq/commits/master
  8. …to the compiler by, you know, actually using the import, right. By doing something stupid like import ( _ "github.com/lib/pq" _ "image/png" ... ) Oh. Look. Problem solved. You mark a package as "I imported this specifically for its side…
    comment by dmitriid · 2021-03-24 · in Darker Corners of Go
  9. …maintainers to acknowledge init() can be poisonous... [1] [0] https://go-proverbs.github.io/ [1] https://github.com/lib/pq/pull/455
    comment by leetrout · 2019-11-22 · in Go’s Features of Last Resort
  10. …all those imports later if a project moves to another host to avoid Microsoft. [0]: https://godoc.org/github.com/lib/pq
    comment by giancarlostoro · 2018-06-02 · in Microsoft and GitHub have held acquisition talks
  11. …in any Go web frameworks because (almost) all database modules rely on abstraction from stdlib. [1] https://github.com/lib/pq [2] https://github.com/gocraft/dbr [3] https://github.com/jinzhu/gorm [4] https://github.com/boltdb/bolt
    comment by piotrkubisa · 2016-06-21 · in Iris: Fast back-end web framework for Go
  12. …# $GOPATH/.go/vendors sketch # ---------------------------------- lib/mq = github.com/lib/pq@master mgo = labix.org/v2/mgo ... etc # ---------------------------------- # specific project 1 # uses the global version of package
    comment by eternalban · 2015-04-29 · in Reproducible Builds in Go
  13. ▲ 88
    Pure Go Postgres driver for database/sql
    story by anonfunction · 2014-12-19 · 4 comments
  14. We are using https://github.com/go-pg/pg for Postgres with some luck, but I think the standard is https://github.com/lib/pq . We are also developing a driver for Orient DB with the goal of it being production ready.
    comment by chris0987 · 2014-11-19 · in Swift and Go: Building a Fast Future
  15. That's all golang has, it's pretty much like other languages :) github.com/lib/pq is a typical driver, which returns rows of values which you read to recreate your objects.
  16. …what you would do. Or how you have to import a singleton to load the database driver you want. import ( _ "github.com/lib/pq" "database/sql" <----- Previous import has side effects. ) How is that idiomatic go? -__- It's totally a hack.…
    comment by shadowmint · 2014-01-27 · in A RESTful Micro-Framework in Go
  17. Yeah, but that's an older unmaintained version. Official is at https://github.com/lib/pq , and I already shaved my yak. :) https://github.com/lib/pq/pull/135
    comment by mattrobenolt · 2013-09-25 · in Scaling Django to 8 Billion Page Views
  18. …into some JSON. If that table were Postgres you would probably use the driver located here: https://github.com/lib/pq You could connect to the database and populate your record from the database thus: db, err := sql.Open("postgres",…
    comment by buro9 · 2013-03-28 · in Go Concurrency
  19. …probably one of the best Mongo libraries out there (even 10gen thinks so): http://labix.org/mgo And http://github.com/lib/pq for Postgres.
    comment by treeder · 2013-03-12 · in How We Went from 30 Servers to 2: Go