Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultPostgresMaxOpenConns = 25 DefaultPostgresMaxIdleConns = 5 DefaultPostgresConnMaxLifetime = 30 * time.Minute DefaultPostgresConnMaxIdleTime = 5 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
func ConnectWithOptions ¶
func ConnectWithOptions(databaseURL string, options ConnectionOptions) (*bun.DB, error)
ConnectWithOptions creates a database connection based on the provided DATABASE_URL and optional pool tuning overrides.
func GetDatabaseType ¶
GetDatabaseType returns the database type from a DATABASE_URL
Types ¶
type Config ¶
type Config struct {
Type string
Host string
Port string
Database string
Username string
Password string
SSLMode string
Path string // For SQLite
}
Config holds database connection configuration
func ParseDatabaseURL ¶
ParseDatabaseURL parses a DATABASE_URL and returns a DatabaseConfig
Click to show internal directories.
Click to hide internal directories.