aboutsummaryrefslogtreecommitdiff
path: root/userapi/storage/devices/sqlite3/storage.go
diff options
context:
space:
mode:
Diffstat (limited to 'userapi/storage/devices/sqlite3/storage.go')
-rw-r--r--userapi/storage/devices/sqlite3/storage.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/userapi/storage/devices/sqlite3/storage.go b/userapi/storage/devices/sqlite3/storage.go
index b9f08ca1..1f2b59f3 100644
--- a/userapi/storage/devices/sqlite3/storage.go
+++ b/userapi/storage/devices/sqlite3/storage.go
@@ -20,6 +20,7 @@ import (
"database/sql"
"encoding/base64"
+ "github.com/matrix-org/dendrite/internal/config"
"github.com/matrix-org/dendrite/internal/sqlutil"
"github.com/matrix-org/dendrite/userapi/api"
"github.com/matrix-org/gomatrixserverlib"
@@ -37,16 +38,11 @@ type Database struct {
}
// NewDatabase creates a new device database
-func NewDatabase(dataSourceName string, serverName gomatrixserverlib.ServerName) (*Database, error) {
- var db *sql.DB
- var err error
- cs, err := sqlutil.ParseFileURI(dataSourceName)
+func NewDatabase(dbProperties *config.DatabaseOptions, serverName gomatrixserverlib.ServerName) (*Database, error) {
+ db, err := sqlutil.Open(dbProperties)
if err != nil {
return nil, err
}
- if db, err = sqlutil.Open(sqlutil.SQLiteDriverName(), cs, nil); err != nil {
- return nil, err
- }
d := devicesStatements{}
if err = d.prepare(db, serverName); err != nil {
return nil, err