fix database issues

This commit is contained in:
rogee
2023-02-07 00:14:30 +08:00
parent 47e8139f47
commit 032cfbc283
10 changed files with 129 additions and 102 deletions

View File

@@ -0,0 +1,18 @@
package database
import (
"atom/providers/config"
// "gorm.io/driver/sqlite"
"github.com/glebarez/sqlite"
"gorm.io/gorm"
)
func NewSQLite(conf *config.SQLite) (*gorm.DB, error) {
db, err := gorm.Open(sqlite.Open(conf.File), &gorm.Config{})
if err != nil {
return nil, err
}
return db, err
}