i'd like to share gorm.DB instances among goroutines after being created with gorm.Open but don't know whether its goroutine-safe or not.

Comment From: tsirolnik

I've tried it and it seems to duplicate the connection for each goroutine that is created

Comment From: jinzhu

yes.

Comment From: stevenup

So how do you share db connection between goroutines? I have a worker running db query but it always return Open too many files after some time. Thanks! @tsirolnik