mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-29 12:42:46 +00:00
Fix #842 - again...
This commit is contained in:
parent
ee8e167844
commit
9e489845eb
6 changed files with 6 additions and 24 deletions
|
@ -16,7 +16,6 @@ package storage
|
|||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"net/url"
|
||||
|
||||
"github.com/matrix-org/dendrite/common"
|
||||
|
@ -34,14 +33,12 @@ type Database interface {
|
|||
func NewDatabase(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.NewDatabase(dataSourceName)
|
||||
}
|
||||
switch uri.Scheme {
|
||||
case "postgres":
|
||||
return postgres.NewDatabase(dataSourceName)
|
||||
default:
|
||||
return nil, errors.New("unknown schema")
|
||||
return postgres.NewDatabase(dataSourceName)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue