增加sqlite数据库的初始化

This commit is contained in:
Arthur Liu
2021-06-10 12:15:40 +08:00
parent 9b47c8f57c
commit 4902101cbe
8 changed files with 164 additions and 57 deletions
+2 -1
View File
@@ -11,7 +11,8 @@ type Server struct {
// auto
AutoCode Autocode `mapstructure:"autoCode" json:"autoCode" yaml:"autoCode"`
// gorm
Mysql Mysql `mapstructure:"mysql" json:"mysql" yaml:"mysql"`
Mysql Mysql `mapstructure:"mysql" json:"mysql" yaml:"mysql"`
Sqlite Sqlite `mapstructure:"sqlite" json:"sqlite" yaml:"sqlite"`
// oss
Local Local `mapstructure:"local" json:"local" yaml:"local"`
Qiniu Qiniu `mapstructure:"qiniu" json:"qiniu" yaml:"qiniu"`
+6
View File
@@ -1,5 +1,11 @@
package config
type Sqlite struct {
Path string `mapstructure:"path" json:"path" yaml:"path"` // 数据库路径
Config string `mapstructure:"config" json:"config" yaml:"config"` // 高级配置
Dbname string `mapstructure:"db-name" json:"dbname" yaml:"db-name"` // 数据库名
}
type Mysql struct {
Path string `mapstructure:"path" json:"path" yaml:"path"` // 服务器地址:端口
Config string `mapstructure:"config" json:"config" yaml:"config"` // 高级配置