mirror of
https://gitee.com/johng/gf
synced 2026-06-06 16:21:40 +08:00
comment update for package contrib/drivers/mysql (#2649)
This commit is contained in:
@ -76,6 +76,7 @@ func (d *Driver) Open(config *gdb.ConfigNode) (db *sql.DB, err error) {
|
||||
source, _ = gregex.ReplaceString(`/([\w\.\-]+)+`, "/"+config.Name, source)
|
||||
}
|
||||
} else {
|
||||
// TODO: Do not set charset when charset is not specified (in v2.5.0)
|
||||
source = fmt.Sprintf(
|
||||
"%s:%s@%s(%s:%s)/%s?charset=%s",
|
||||
config.User, config.Pass, config.Protocol, config.Host, config.Port, config.Name, config.Charset,
|
||||
|
||||
@ -38,7 +38,7 @@ type ConfigNode struct {
|
||||
Prefix string `json:"prefix"` // (Optional) Table prefix.
|
||||
DryRun bool `json:"dryRun"` // (Optional) Dry run, which does SELECT but no INSERT/UPDATE/DELETE statements.
|
||||
Weight int `json:"weight"` // (Optional) Weight for load balance calculating, it's useless if there's just one node.
|
||||
Charset string `json:"charset"` // (Optional, "utf8mb4" in default) Custom charset when operating on database.
|
||||
Charset string `json:"charset"` // (Optional, "utf8" in default) Custom charset when operating on database.
|
||||
Protocol string `json:"protocol"` // (Optional, "tcp" in default) See net.Dial for more information which networks are available.
|
||||
Timezone string `json:"timezone"` // (Optional) Sets the time zone for displaying and interpreting time stamps.
|
||||
Namespace string `json:"namespace"` // (Optional) Namespace for some databases. Eg, in pgsql, the `Name` acts as the `catalog`, the `NameSpace` acts as the `schema`.
|
||||
|
||||
Reference in New Issue
Block a user