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.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/syncapi/storage/storage.go b/syncapi/storage/storage.go
index 7f9c28e9..5b20c6cc 100644
--- a/syncapi/storage/storage.go
+++ b/syncapi/storage/storage.go
@@ -20,18 +20,19 @@ package storage
import (
"fmt"
+ "github.com/matrix-org/dendrite/setup/base"
"github.com/matrix-org/dendrite/setup/config"
"github.com/matrix-org/dendrite/syncapi/storage/postgres"
"github.com/matrix-org/dendrite/syncapi/storage/sqlite3"
)
// NewSyncServerDatasource opens a database connection.
-func NewSyncServerDatasource(dbProperties *config.DatabaseOptions) (Database, error) {
+func NewSyncServerDatasource(base *base.BaseDendrite, dbProperties *config.DatabaseOptions) (Database, error) {
switch {
case dbProperties.ConnectionString.IsSQLite():
- return sqlite3.NewDatabase(dbProperties)
+ return sqlite3.NewDatabase(base, dbProperties)
case dbProperties.ConnectionString.IsPostgres():
- return postgres.NewDatabase(dbProperties)
+ return postgres.NewDatabase(base, dbProperties)
default:
return nil, fmt.Errorf("unexpected database type")
}