mirror of
https://github.com/flipped-aurora/gin-vue-admin.git
synced 2026-09-21 12:32:25 +00:00
[feature]:支持Sqlite数据库 (#1467)
* add sqlite3 support * 修改gorm.io/driver/sqlite 为 github.com/glebarez/sqlite 适配windows用户无cgo环境 --------- Co-authored-by: Kafumio <linzehong1_2020@qq.com> Co-authored-by: Kafumio <73083337+Kafumio@users.noreply.github.com> Co-authored-by: sliverhorn <sliver_horn@qq.com>
This commit is contained in:
committed by
GitHub
co-authored by
Kafumio
Kafumio
sliverhorn
parent
7ababb626b
commit
bd3931d62d
@@ -14,6 +14,7 @@ type Server struct {
|
||||
Mssql Mssql `mapstructure:"mssql" json:"mssql" yaml:"mssql"`
|
||||
Pgsql Pgsql `mapstructure:"pgsql" json:"pgsql" yaml:"pgsql"`
|
||||
Oracle Oracle `mapstructure:"oracle" json:"oracle" yaml:"oracle"`
|
||||
Sqlite Sqlite `mapstructure:"sqlite" json:"sqlite" yaml:"sqlite"`
|
||||
DBList []SpecializedDB `mapstructure:"db-list" json:"db-list" yaml:"db-list"`
|
||||
// oss
|
||||
Local Local `mapstructure:"local" json:"local" yaml:"local"`
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package config
|
||||
|
||||
type Sqlite struct {
|
||||
GeneralDB `yaml:",inline" mapstructure:",squash"`
|
||||
}
|
||||
|
||||
func (s *Sqlite) Dsn() string {
|
||||
return s.Path + "\\" + s.Dbname + ".db"
|
||||
}
|
||||
|
||||
func (s *Sqlite) GetLogMode() string {
|
||||
return s.LogMode
|
||||
}
|
||||
Reference in New Issue
Block a user