mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-16 11:23:11 -06:00
Merge branch 'master' of github.com:matrix-org/dendrite into anoa/fix_lint_ci
This commit is contained in:
commit
97e06629f1
|
|
@ -33,7 +33,9 @@ type Database interface {
|
|||
func NewDatabase(dataSourceName string) (Database, error) {
|
||||
uri, err := url.Parse(dataSourceName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
// 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":
|
||||
|
|
|
|||
|
|
@ -34,12 +34,14 @@ type Database interface {
|
|||
func NewDatabase(dataSourceName string) (Database, error) {
|
||||
uri, err := url.Parse(dataSourceName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
// 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 errors.New("unknown schema")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,9 @@ type Database interface {
|
|||
func Open(dataSourceName string) (Database, error) {
|
||||
uri, err := url.Parse(dataSourceName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
// 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":
|
||||
|
|
|
|||
|
|
@ -39,7 +39,9 @@ type Database interface {
|
|||
func NewPublicRoomsServerDatabase(dataSourceName string) (Database, error) {
|
||||
uri, err := url.Parse(dataSourceName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
// if the scheme doesn't match, fall back to postgres in case the config has
|
||||
// postgres key=value connection strings
|
||||
return postgres.NewPublicRoomsServerDatabase(dataSourceName)
|
||||
}
|
||||
switch uri.Scheme {
|
||||
case "postgres":
|
||||
|
|
|
|||
|
|
@ -61,7 +61,9 @@ type Database interface {
|
|||
func Open(dataSourceName string) (Database, error) {
|
||||
uri, err := url.Parse(dataSourceName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
// 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":
|
||||
|
|
|
|||
|
|
@ -52,7 +52,9 @@ type Database interface {
|
|||
func NewSyncServerDatasource(dataSourceName string) (Database, error) {
|
||||
uri, err := url.Parse(dataSourceName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
// if the scheme doesn't match, fall back to postgres in case the config has
|
||||
// postgres key=value connection strings
|
||||
return postgres.NewSyncServerDatasource(dataSourceName)
|
||||
}
|
||||
switch uri.Scheme {
|
||||
case "postgres":
|
||||
|
|
|
|||
Loading…
Reference in a new issue