Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SharedPool ¶
type SharedPool struct {
// contains filtered or unexported fields
}
SharedPool manages a single shared PostgreSQL connection pool. Multiple repositories and stores can use the same pool to reduce connection overhead.
func NewSharedPool ¶
func NewSharedPool(connectionString string, poolConfig config.PostgresPoolConfig) (*SharedPool, error)
NewSharedPool creates a new shared PostgreSQL connection pool.
func (*SharedPool) Close ¶
func (p *SharedPool) Close() error
Close closes the shared connection pool. This should only be called once when the application shuts down. sql.DB.Close() is safe to call multiple times.
func (*SharedPool) DB ¶
func (p *SharedPool) DB() *sql.DB
DB returns the underlying *sql.DB for use by repositories.
Click to show internal directories.
Click to hide internal directories.