feat(ftp): support receive ftp connection (#6)

Co-authored-by: E99p1ant <[email protected]>
This commit is contained in:
Li4n0
2021-04-25 13:39:27 +08:00
committed by GitHub
co-authored by E99p1ant
parent 5e24f9530d
commit 26755351f7
36 changed files with 1446 additions and 141 deletions
+8
View File
@@ -1,11 +1,19 @@
package database
import (
"strings"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
)
func NewSqlite3(dsn string) (*gorm.DB, error) {
if strings.Contains(dsn, "?") {
dsn += "&_synchronous=1&_journal_mode=WAL"
} else {
dsn += "?_synchronous=1&_journal_mode=WAL"
}
db, err := gorm.Open(sqlite.Open(dsn), &gorm.Config{})
if err != nil {
return nil, err