-
-
Notifications
You must be signed in to change notification settings - Fork 404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does pg.DB support concurrent calls? #50
Comments
Actually it is the opposite.
|
Wow you are right. I was using gorp, and it called rows.Close() for me, so I didn't realize it was necessary. That's great! Thanks a lot for this great library. I'm migrating my application from gorp to pg. After playing with pgx and some other libs I've come to conclusion that yours is the best one, hands down. Two things I was missing and had to implement manually are a way to insert an entire object and nil receivers:
The nil receiver thing means less typing if you need a pointer, and it's also easier to check if nothing was found by simply comparing the receiver to nil afterwards. Would you be willing to accept these 2 features if I submitted a pull request? |
This is the desired behaviour and I will accept a PR implementing it. Though keep in mind that
Adding |
Ok great, I'll submit a pull request before Tuesday. Thanks! |
Hello,
I see that unlike sql.DB, pg.DB needs to be closed explicitly via Close()
What I like about sql.DB is that I can open it once when my web application starts, and then safely use it in all go routines/HTTP requests.
Can I do the same with pg.DB, or do I need to call Connect()/Close() in every handler?
Thanks!
The text was updated successfully, but these errors were encountered: