db: use Opaque for db conn url

This commit is contained in:
sentriz
2020-05-01 21:31:57 +01:00
parent 824048796e
commit d583c2fbd8

View File

@@ -48,7 +48,11 @@ type DB struct {
}
func New(path string) (*DB, error) {
url := url.URL{Path: path}
// https://github.com/mattn/go-sqlite3#connection-string
url := url.URL{
Scheme: "file",
Opaque: path,
}
url.RawQuery = dbOptions.Encode()
db, err := gorm.Open("sqlite3", url.String())
if err != nil {