Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
DriverName string `json:"driverName"` // 驱动名称,默认为 "mysql"。
ServerVersion string `json:"serverVersion,omitempty"` // 服务器版本,默认为空。
DSN string `json:"dsn,omitempty"` // DSN 字符串,默认为空。
DSNConfig *mysqld.Config `json:"-"` // DSN 配置
Conn gorm.ConnPool `json:"connPool,omitempty"` // 连接池,默认为空。
SkipInitializeWithVersion bool `json:"skipInitializeWithVersion"` // 跳过与版本号相关的初始化,默认为 false。
DefaultStringSize uint `json:"defaultStringSize"` // 字符串的默认长度,默认为 0。
DefaultDatetimePrecision *int `json:"defaultDatetimePrecision"` // 日期时间的默认精度,默认为 nil。
DisableWithReturning bool `json:"disableWithReturning"` // 禁用 WITH RETURNING,默认为 false。
DisableDatetimePrecision bool `json:"disableDatetimePrecision"` // 禁用日期时间精度,默认为 false。
DontSupportRenameIndex bool `json:"dontSupportRenameIndex"` // 不支持重命名索引,默认为 false。
DontSupportRenameColumn bool `json:"dontSupportRenameColumn"` // 不支持重命名列,默认为 false。
DontSupportNullAsDefaultValue bool `json:"dontSupportNullAsDefaultValue"` // 不支持 NULL 作为默认值,默认为 false。
DontSupportRenameColumnUnique bool `json:"dontSupportRenameColumnUnique"` // 不支持重命名列的唯一性约束,默认为 false。
// As of MySQL 8.0.19, ALTER TABLE permits more general (and SQL standard) syntax
// for dropping and altering existing constraints of any type.
// see https://dev.mysql.com/doc/refman/8.0/en/alter-table.html
DontSupportDropConstraint bool `json:"dontSupportDropConstraint"` // 不支持使用 DROP CONSTRAINT 语法来删除约束,默认为 false。
SSH *ssh.Config `json:"ssh,omitempty"` // SSH 配置选项,默认为 nil。
}
Config 定义 MySQL 数据库驱动程序的配置选项。
Click to show internal directories.
Click to hide internal directories.