Discover Packages
gitee.com/jason-laf/common
database
package
Version:
v0.0.0-...-6f596e7
Opens a new window with list of versions in this module.
Published: Mar 9, 2024
License: Apache-2.0
Opens a new window with license information.
Imports: 12
Opens a new window with list of imports.
Imported by: 1
Opens a new window with list of known importers.
Documentation
Documentation
¶
type DBConfig struct {
Host string `mapstructure:"host"`
Port int `mapstructure:"port"`
Database string `mapstructure:"database"`
User string `mapstructure:"user"`
Password string `mapstructure:"password"`
}
type GormList struct {
List []string `json:"val"`
}
GormList 定义了一个 GormList 类型,用于存储多个字符串
Scan 实现了 sql.Scanner 接口,将数据库中的数据转换为 GormList 类型。
Value 实现了 driver.Valuer 接口,将 GormList 类型转换为 JSON 字符串用于存储在数据库中。
Source Files
¶
Click to show internal directories.
Click to hide internal directories.