manager

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(b DSNParser)

Types

type DSN

type DSN struct {
	User     string            // Username
	Password string            // Password (requires User)
	Net      string            // Network type
	Addr     string            // Network address (requires Net)
	DBName   string            // Database name
	Params   map[string]string // Connection parameters
}

DSN ...

type DSNParser

type DSNParser interface {
	GetDialector(dsn string) gorm.Dialector
	ParseDSN(dsn string) (cfg *DSN, err error)
	Scheme() string
	// NamingStrategy gorm naming strategy
	// 该方法主要用于达梦数据库
	// 达梦数据库的表名和字段名都是大写的,gorm默认的策略是小写
	// 所以需要该方法来设置gorm的达梦命名策略
	NamingStrategy() schema.Namer
}

func Get

func Get(scheme string) DSNParser

Get returns the dsn builder registered with the given scheme.

If no builder is register with the scheme, nil will be returned.

Jump to

Keyboard shortcuts

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