Database Connection Pools lib/pq

177 views
Skip to first unread message

will

unread,
Jun 19, 2015, 6:20:56 AM6/19/15
to golan...@googlegroups.com
Hi gophers,

I was wondering how connection pools are managed using the lib/sq library.

Of concern are :
  • setting closure of connection pools that are idle for say 10 minutes
  • setting maximum number of connections in the pool
  • release times for pools etc
regards,

Will

Kiki Sugiaman

unread,
Jun 19, 2015, 6:40:36 AM6/19/15
to golan...@googlegroups.com
The API for setting max # of conns is available through database/sql.
I'm not aware of how to release connections using timeout. My mental model so far is: if I fail to close a connection, then my program is leaky.
If I need a timeout, I implement it myself, closing the connection explicitly at the end of the timeout.
Maybe someone else with more experience can fill in on the timeout.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages