aboutsummaryrefslogtreecommitdiff
path: root/syncapi/storage/storage.go
diff options
context:
space:
mode:
Diffstat (limited to 'syncapi/storage/storage.go')
-rw-r--r--syncapi/storage/storage.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/syncapi/storage/storage.go b/syncapi/storage/storage.go
index c56db063..9574f37b 100644
--- a/syncapi/storage/storage.go
+++ b/syncapi/storage/storage.go
@@ -19,22 +19,23 @@ package storage
import (
"net/url"
+ "github.com/matrix-org/dendrite/common"
"github.com/matrix-org/dendrite/syncapi/storage/postgres"
"github.com/matrix-org/dendrite/syncapi/storage/sqlite3"
)
-// NewPublicRoomsServerDatabase opens a database connection.
-func NewSyncServerDatasource(dataSourceName string) (Database, error) {
+// NewSyncServerDatasource opens a database connection.
+func NewSyncServerDatasource(dataSourceName string, dbProperties common.DbProperties) (Database, error) {
uri, err := url.Parse(dataSourceName)
if err != nil {
- return postgres.NewSyncServerDatasource(dataSourceName)
+ return postgres.NewSyncServerDatasource(dataSourceName, dbProperties)
}
switch uri.Scheme {
case "postgres":
- return postgres.NewSyncServerDatasource(dataSourceName)
+ return postgres.NewSyncServerDatasource(dataSourceName, dbProperties)
case "file":
return sqlite3.NewSyncServerDatasource(dataSourceName)
default:
- return postgres.NewSyncServerDatasource(dataSourceName)
+ return postgres.NewSyncServerDatasource(dataSourceName, dbProperties)
}
}