aboutsummaryrefslogtreecommitdiff
path: root/appservice/storage/sqlite3/storage.go
diff options
context:
space:
mode:
Diffstat (limited to 'appservice/storage/sqlite3/storage.go')
-rw-r--r--appservice/storage/sqlite3/storage.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/appservice/storage/sqlite3/storage.go b/appservice/storage/sqlite3/storage.go
index cb55c8d9..59af9016 100644
--- a/appservice/storage/sqlite3/storage.go
+++ b/appservice/storage/sqlite3/storage.go
@@ -20,6 +20,7 @@ import (
"database/sql"
// Import SQLite database driver
+ "github.com/matrix-org/dendrite/internal/config"
"github.com/matrix-org/dendrite/internal/sqlutil"
"github.com/matrix-org/gomatrixserverlib"
_ "github.com/mattn/go-sqlite3"
@@ -34,14 +35,10 @@ type Database struct {
}
// NewDatabase opens a new database
-func NewDatabase(dataSourceName string) (*Database, error) {
+func NewDatabase(dbProperties *config.DatabaseOptions) (*Database, error) {
var result Database
var err error
- cs, err := sqlutil.ParseFileURI(dataSourceName)
- if err != nil {
- return nil, err
- }
- if result.db, err = sqlutil.Open(sqlutil.SQLiteDriverName(), cs, nil); err != nil {
+ if result.db, err = sqlutil.Open(dbProperties); err != nil {
return nil, err
}
if err = result.prepare(); err != nil {