connection

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager manages multiple database connections

func NewManager

func NewManager() *Manager

NewManager creates a new database connection manager

func (*Manager) CloseAllConnections

func (m *Manager) CloseAllConnections() error

CloseAllConnections closes all database connections

func (*Manager) CloseConnection

func (m *Manager) CloseConnection(name string) error

CloseConnection closes a database connection

func (*Manager) Connect

func (m *Manager) Connect(name, driver, dsn string) (*gorm.DB, error)

Connect establishes a database connection

func (*Manager) GetConnection

func (m *Manager) GetConnection(name string) (*gorm.DB, error)

GetConnection retrieves an existing database connection

func (*Manager) ListConnections

func (m *Manager) ListConnections() []string

ListConnections returns a list of all connection names

func (*Manager) Ping

func (m *Manager) Ping(name string) error

Ping tests a database connection

func (*Manager) PingAll

func (m *Manager) PingAll() map[string]error

PingAll tests all database connections

Jump to

Keyboard shortcuts

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