mysql

package
v0.0.0-...-e5f6f6e Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MySQL

type MySQL struct {
	Driver          string        `mapstructure:"driver" ini:"driver" json:"driver" toml:"driver" xml:"driver" yaml:"driver" validate:"required,oneof=mysql"`
	UserName        string        `mapstructure:"username" ini:"username" json:"username" toml:"username" xml:"username" yaml:"username" validate:"required"`
	Password        string        `mapstructure:"password" ini:"password" json:"password" toml:"password" xml:"password" yaml:"password" validate:"-"`
	Protocol        string        `` /* 192-byte string literal not displayed */
	Address         string        `mapstructure:"address" ini:"address" json:"address" toml:"address" xml:"address" yaml:"address" validate:"-"`
	Database        string        `mapstructure:"database" ini:"database" json:"database" toml:"database" xml:"database" yaml:"database" validate:"-"`
	Parameters      *Parameters   `` /* 192-byte string literal not displayed */
	ConnMaxLifeTime time.Duration `` /* 174-byte string literal not displayed */
	ConnMaxIdleTime time.Duration `` /* 196-byte string literal not displayed */
	MaxOpenConns    int           `` /* 150-byte string literal not displayed */
	MaxIdleConns    int           `` /* 169-byte string literal not displayed */
}

func (*MySQL) DSN

func (db *MySQL) DSN() (dsn string, err error)

type Parameters

type Parameters struct {
	AllowAllFiles           bool   ``                                                                                                                         /* 149-byte string literal not displayed */
	AllowCleartextPasswords bool   ``                                                                                                                         /* 216-byte string literal not displayed */
	AllowNativePasswords    bool   ``                                                                                                                         /* 198-byte string literal not displayed */
	AllowOldPasswords       bool   ``                                                                                                                         /* 180-byte string literal not displayed */
	Charset                 string `mapstructure:"charset" ini:"charset" json:"charset" toml:"charset" xml:"charset" yaml:"charset" validate:"-"`             //charset=utf8mb4,utf8,不建议使用charset参数,因为它会向服务器发出额外的查询。除非需要备用行为,否则请使用排序规则collection。
	CheckConnLiveness       bool   ``                                                                                                                         /* 180-byte string literal not displayed */
	Collation               string `mapstructure:"collation" ini:"collation" json:"collation" toml:"collation" xml:"collation" yaml:"collation" validate:"-"` //utf8mb4_general_ci ,utf8_general_ci
	ClientFoundRows         bool   ``                                                                                                                         /* 168-byte string literal not displayed */
	ColumnsWithAlias        bool   ``                                                                                                                         /* 174-byte string literal not displayed */
	InterpolateParams       bool   ``                                                                                                                         // isdefault
	/* 174-byte string literal not displayed */
	Loc              string  `mapstructure:"loc" ini:"loc" json:"loc" toml:"loc" xml:"loc" yaml:"loc" validate:"timezone"` // when using parseTime=true 'Local" sets the system's location.
	MaxAllowedPacket float64 ``                                                                                            // 4194304 允许的最大数据包大小(以字节为单位)。缺省值为4mib,需要根据服务器的设置进行调整。maxAllowedPacket=0可以用来在每次连接时自动从服务器获取max_allowed_packet变量。
	/* 174-byte string literal not displayed */
	MultiStatements bool `` // 一个查询中允许多个语句。虽然这允许批量查询,但也大大增加了SQL注入的风险。只返回第一个查询的结果,所有其他结果将被静默丢弃。当使用multiStatements时,?参数只能在第一条语句中使用。
	/* 162-byte string literal not displayed */
	ParseTime   bool          `` /* 126-byte string literal not displayed */
	ReadTimeout time.Duration `` // I/O read timeout. The value must be a decimal number with a unit suffix ("ms", "s", "m", "h"), such as "30s", "0.5m" or "1m30s".
	/* 138-byte string literal not displayed */
	RejectReadOnly bool          ``                                                                                                             /* 162-byte string literal not displayed */
	ServerPubKey   string        ``                                                                                                             /* 150-byte string literal not displayed */
	Timeout        time.Duration `mapstructure:"timeout" ini:"timeout" json:"timeout" toml:"timeout" xml:"timeout" yaml:"timeout" validate:"-"` //Timeout for establishing connections, aka dial timeout. The value must be a decimal number with a unit suffix ("ms", "s", "m", "h"), such as "30s", "0.5m" or "1m30s".
	Tls            interface{}   `mapstructure:"tls" ini:"tls" json:"tls" toml:"tls" xml:"tls" yaml:"tls" validate:"-"`                         // Valid Values:   true, false, skip-verify, preferred, <name>
	WriteTimeout   time.Duration ``                                                                                                             /* 144-byte string literal not displayed */
}

Jump to

Keyboard shortcuts

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