lib / pq

Pure Go Postgres driver for database/sql
https://pkg.go.dev/github.com/lib/pq
MIT License
8.89k stars 906 forks source link

Can you explain the simpleQuery implementation? #1019

Open mhatch-sc opened 3 years ago

mhatch-sc commented 3 years ago

I see this PR makes it safer to Ping the db, even when a txn has failed. But I don't fully grok it. Specifically, I'm wondering how a caller can be certain that rows aren't nil? It looks like here that simpleQuery could return nil rows and a nil error. Is my understanding incorrect?

Thanks