支持sqlite数据库驱动

This commit is contained in:
2023-04-18 17:53:53 +08:00
parent 244803880e
commit 5cf6886c53
4 changed files with 42 additions and 11 deletions

View File

@ -49,16 +49,17 @@ const (
//
// Date : 15:19 2022/6/9
type Database struct {
Master *Mysql `json:"master" yaml:"master"` // 主库配置
Slave *Mysql `json:"slave" yaml:"slave"` // 从库配置
Master *Driver `json:"master" yaml:"master"` // 主库配置
Slave *Driver `json:"slave" yaml:"slave"` // 从库配置
}
// Mysql ...
// Driver ...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 18:44 2022/5/14
type Mysql struct {
type Driver struct {
DBType string `json:"db_type" yaml:"db_type"` // 数据库驱动类型
Host string `json:"host" yaml:"host"` // 数据库地址
Port int `json:"port" yaml:"port"` // 数据库端口
Username string `json:"username" yaml:"username"` // 用户名
@ -69,6 +70,13 @@ type Mysql struct {
Timezone string `json:"timezone" yaml:"timezone"` // 时区
}
const (
// DriverTypeMysql mysql 驱动
DriverTypeMysql = "mysql"
// DriverTypeSqlite3 sqlite3
DriverTypeSqlite3 = "sqlite3"
)
// Connection 连接数配置
//
// Author : go_developer@163.com<白茶清欢>