This commit is contained in:
henry
2021-11-02 09:43:19 +08:00
parent 570bb3c772
commit 4734344985
78 changed files with 4798 additions and 0 deletions

19
serve/orm/logic/sqlite.go Normal file
View File

@ -0,0 +1,19 @@
package logic
import (
"github.com/belief428/gorm-engine/tools"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
)
type Sqlite struct {
Path string
Name string
}
func (this *Sqlite) DSN() gorm.Dialector {
if isExist, _ := tools.PathExists(this.Path); !isExist {
_ = tools.MkdirAll(this.Path)
}
return sqlite.Open(this.Path + "/" + this.Name)
}