Add --sqlite option (#4841)

This commit is contained in:
andig 2022-10-16 14:19:22 +02:00 • committed by GitHub
parent b26cf6d9b9
commit 59bcc1fa52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 2 deletions

View file

@ -26,7 +26,8 @@ func New(driver, dsn string) (*gorm.DB, error) {
if err := os.MkdirAll(filepath.Dir(file), os.ModePerm); err != nil {
return nil, err
}
dialect = sqlite.Open(file)
// avoid busy errors
dialect = sqlite.Open(file + "?_pragma=busy_timeout(5000)")
// case "postgres":
// dialect = postgres.Open(dsn)
// case "mysql":