Documentation
¶
Index ¶
Constants ¶
View Source
const ( Mysql = "mysql" Postgres = "postgres" ClickHouse = "clickhouse" SqlServer = "sqlserver" )
数据库类型
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Dialect string `json:"dialect" yaml:"dialect" nacos:"database.dialect"` // 数据库类型
Host string `json:"host" yaml:"host" nacos:"database.host"` // 数据库Host
Port string `json:"port" yaml:"port" nacos:"database.port"` // 数据库端口
DbName string `json:"dbName" yaml:"dbName" nacos:"database.dbName"` // 数据库名
UserName string `json:"userName" yaml:"userName" nacos:"database.userName"` // 用户名
Password string `json:"password" yaml:"password" nacos:"database.password"` // 密码
Debug bool `json:"debug" yaml:"debug" nacos:"database.debug"` // 是否开启debug
InitTable bool `json:"initTable" yaml:"initTable" nacos:"database.initTable"` // 是否初始化表结构
}
数据源配置
var CONFIG *Config
func (*Config) NewGormCTL ¶ added in v1.2.0
创建数据库连接
Click to show internal directories.
Click to hide internal directories.