dbpool

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2025 License: MIT Imports: 4 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL