Fix #842 - again...

This commit is contained in:
Neil Alexander 2020-01-09 17:18:19 +00:00
parent ee8e167844
commit 9e489845eb
6 changed files with 6 additions and 24 deletions

View file

@ -16,7 +16,6 @@ package storage
import (
"context"
"errors"
"net/url"
"github.com/matrix-org/dendrite/roomserver/api"
@ -61,14 +60,12 @@ type Database interface {
func Open(dataSourceName string) (Database, error) {
uri, err := url.Parse(dataSourceName)
if err != nil {
// if the scheme doesn't match, fall back to postgres in case the config has
// postgres key=value connection strings
return postgres.Open(dataSourceName)
}
switch uri.Scheme {
case "postgres":
return postgres.Open(dataSourceName)
default:
return nil, errors.New("unknown schema")
return postgres.Open(dataSourceName)
}
}