Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
NotSetupError = errorKit.New("Haven’t been set up correctly")
)
Functions ¶
func CreateDatabaseIfNotExists ¶
CreateDatabaseIfNotExists 自动创建数据库
在 Go 项目中优雅的使用 gorm v2
https://segmentfault.com/a/1190000039097157
Types ¶
type Config ¶
type Config struct { DsnConfig Log LogConfig `json:"log" yaml:"log"` Pool PoolConfig `json:"pool" yaml:"pool"` }
type DsnConfig ¶
type DsnConfig struct { UserName string `json:"userName" yaml:"userName"` Password string `json:"password,optional" yaml:"password"` // Host e.g."127.0.0.1:3306" Host string `json:"host" yaml:"host"` DBName string `json:"dbName" yaml:"dbName"` }
func (*DsnConfig) ToDsnString ¶
Click to show internal directories.
Click to hide internal directories.