Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( PostgresDialect = Dialect{ // contains filtered or unexported fields } CockroachDialect = Dialect{ // contains filtered or unexported fields } MySQLDialect = Dialect{ // contains filtered or unexported fields } SQLiteDialect = Dialect{ // contains filtered or unexported fields } SQLServerDialect = Dialect{ // contains filtered or unexported fields } OracleDialect = Dialect{ // contains filtered or unexported fields } ClickHouseDialect = Dialect{ // contains filtered or unexported fields } DuckDBDialect = Dialect{ // contains filtered or unexported fields } )
Dialects for common database drivers.
Functions ¶
func IsSupportedDriver ¶
IsSupportedDriver reports whether the driver identifier belongs to a supported SQL engine.
Types ¶
type Config ¶
type Config struct {
Driver string
Name string
Source string
Pool PoolConfig
}
Config represents the declaration of a single relational database connection pool.
type Dialect ¶
type Dialect struct {
// contains filtered or unexported fields
}
Dialect provides database-specific placeholder formatting and error code matching.
func ResolveDialect ¶
ResolveDialect returns the canonical Dialect for a given database driver name.
func (Dialect) ExtractErrorCode ¶
ExtractErrorCode extracts the driver error code from an error.
func (Dialect) MatchErrorCode ¶
MatchErrorCode checks if an actual database error matches a catch block error code.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages the thread-safe lifecycle and retrieval of active database connection pools.
func NewManager ¶
func NewManager() *Manager
NewManager initializes an empty connection pool manager.
type PoolConfig ¶
type PoolConfig struct {
MaxOpen int
MaxIdle int
MaxLifetime time.Duration
IdleTimeout time.Duration
}
PoolConfig defines connection pool capacity and lifecycle durations.
func DefaultPoolConfig ¶
func DefaultPoolConfig() PoolConfig
DefaultPoolConfig returns baseline production connection pool settings.